Submission #10229763
Source Code Expand
Q = int(input()) MAX = 10**5 def findAllOfPrime(N): prime = [True] * (N + 1) prime[0] = False prime[1] = False x = 2 while x**2 <= N: if prime[x]: j = 2 while x * j <= N: prime[x * j] = False j += 1 x += 1 return prime prime = findAllOfPrime(MAX) for _ in range(Q): cnt = 0 l, r = map(int, input().split()) for x in range(l, r + 1): if prime[x] and prime[(x + 1) // 2]: cnt += 1 print(cnt)
Submission Info
Submission Time | |
---|---|
Task | D - 2017-like Number |
User | rryyyoooo |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 563 Byte |
Status | TLE |
Exec Time | 2104 ms |
Memory | 3828 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
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 | TLE | 2104 ms | 3828 KB |
02.txt | TLE | 2104 ms | 3828 KB |
03.txt | TLE | 2104 ms | 3828 KB |
04.txt | TLE | 2104 ms | 3828 KB |
05.txt | TLE | 2103 ms | 3828 KB |
06.txt | TLE | 2104 ms | 3828 KB |
07.txt | TLE | 2104 ms | 3828 KB |
sample_01.txt | AC | 50 ms | 3828 KB |
sample_02.txt | AC | 50 ms | 3828 KB |
sample_03.txt | AC | 50 ms | 3828 KB |