Submission #4074946
Source Code Expand
n = (int)(input()) s = [] t = [] for _ in range(n): a, b = (list)(map(int, input().split())) s.append(a) t.append(b) mi = min(s) ma = max(t) def isPrime(n): for i in range(2, n): # 第二引数は sqrt(num)+1 でも良い if n % i == 0: return False return True def prime(s, t): l = [0]*(t+1) c = 0 s = 0 for i in range(s, t+1): if isPrime(i) and isPrime((i+1)//2): c += 1 l[i] = c return l primes = prime(mi, ma) for i in range(n): print(primes[t[i]] - primes[s[i]-1])
Submission Info
Submission Time | |
---|---|
Task | D - 2017-like Number |
User | youth |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 605 Byte |
Status | WA |
Exec Time | 2104 ms |
Memory | 11836 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 | 11836 KB |
02.txt | TLE | 2104 ms | 11836 KB |
03.txt | TLE | 2104 ms | 11792 KB |
04.txt | TLE | 2104 ms | 11796 KB |
05.txt | TLE | 2104 ms | 8596 KB |
06.txt | TLE | 2104 ms | 10280 KB |
07.txt | TLE | 2104 ms | 11748 KB |
sample_01.txt | AC | 18 ms | 3064 KB |
sample_02.txt | AC | 42 ms | 3064 KB |
sample_03.txt | WA | 18 ms | 3064 KB |