Submission #1925392


Source Code Expand

Copy
#include <bits/stdc++.h>
#include <cstring>

using namespace std;

int main()
{
    int n, i, j, a, b, c;
    bool isprime[10010];
    memset(isprime,true,sizeof(isprime));
    for (i=2;i<101;i++){
        for(j=i*2;j<10010;j+=i)
            isprime[j]=false;
    }
    isprime[1]=false;
    cin>>n;
    for(i=0;i<n;i++){
        c=0;
        cin>>a>>b;
        for(j=a;j<=b;j++){
            if(isprime[j] && isprime[(j+1)/2])
                c++;
        }
        cout<<c<<endl;
    }
    return 0;
}

Submission Info

Submission Time
Task D - 2017-like Number
User lentti
Language C++14 (GCC 5.4.1)
Score 0
Code Size 529 Byte
Status RE
Exec Time 298 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 3
RE × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt RE 298 ms 256 KB
02.txt RE 110 ms 256 KB
03.txt RE 109 ms 256 KB
04.txt RE 109 ms 256 KB
05.txt RE 110 ms 256 KB
06.txt RE 108 ms 256 KB
07.txt RE 109 ms 256 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB