s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s420425943
p02257
u894381890
1442212709
Python
Python
py
Runtime Error
0
0
311
import sys import math x_list = [] for line in sys.stdin.readlines(): x_list.append(int(line.strip())) count = 0 x_list.remove(x_list[0]) for i in x_list: flag = 0 for j in range(2, int(math.sqrt(i)+1)): if i % j == 0: flag = 1 break if flag == 0: count ++ print count
File "/tmp/tmp4axocyeq/tmpfbhs7t25.py", line 20 count ++ ^ SyntaxError: invalid syntax
s466322114
p02257
u854228079
1442216847
Python
Python
py
Runtime Error
0
0
303
numbers = [] n = raw_input() for i in range(int(n)): input_num = raw_input() numbers.append(int(input_num)) count = 0 for num in numbers: if num == 2: count += 1 for i in range(2, int(math.sqrt(num)) + 1): if num % i == 0: break count += 1 print count
File "/tmp/tmp5_shr3ck/tmpirnipv1l.py", line 14 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s048204625
p02257
u854228079
1442217039
Python
Python
py
Runtime Error
0
0
303
numbers = [] n = raw_input() for i in range(int(n)): input_num = raw_input() numbers.append(int(input_num)) count = 0 for num in numbers: if num == 2: count += 1 for i in range(2, int(math.sqrt(num)) + 1): if num % i == 0: break count += 1 print count
File "/tmp/tmp3r1tqzcr/tmp1zx_nsaf.py", line 14 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s414143554
p02257
u766163292
1446300012
Python
Python3
py
Runtime Error
0
0
480
#!/usr/bin/env python # -*- coding: utf-8 -*- import math def isprime(n): if n == 2: return True elif n < 2 or n % 2 == 0: return False else: for i in range(3, math.floor(math.sqrt(n)), 2): if x % i == 0: return False else: return True def main(): n = int(input()) ms = (int(input()) for i in range(n)) print(len(list(filter(isprime, ms)))) if __name__ == "__main__": main()
Traceback (most recent call last): File "/tmp/tmpu403nktq/tmpjyaj6occ.py", line 26, in <module> main() File "/tmp/tmpu403nktq/tmpjyaj6occ.py", line 21, in main n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s460476953
p02257
u960191521
1447245693
Python
Python
py
Runtime Error
0
0
969
N = input() prime = 0 checked = 2 primeList = [2] def is_prime(n): global checked if n <= checked: if n in primeList: return True else: return False else:#?´???°????????????n?????§????´???°???????????????????????? for i in xrange(checked+1, n+1): isPrime = True for p in primeList: if i%p == 0: #print "{}%{} == 0".format(i,p) isPrime = False break for p in xrange(checked+1, i): if i%p == 0: #print "{}%{} == 0".format(i,p) isPrime = False break if isPrime: primeList.append(i) checked = n if primeList[-1] == n: return True else: return False for _ in xrange(N): n = input() prime += 1 if is_prime(n) else 0 print prime
File "/tmp/tmpxl1s0c72/tmpud6vihdp.py", line 38 print prime ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s538417078
p02257
u963402991
1447734529
Python
Python3
py
Runtime Error
0
0
294
n = list(map(int,input().split())) def Is_prime(n): if n % 2 == 0: return False i = 3 while i < int(n ** (0.5))+ 1: if n % i == 0: return False return True count = 1 for j in range(0,len(n)): if Is_prime(n[i]): count += 1 print (count)
Traceback (most recent call last): File "/tmp/tmpk77aglsr/tmpg_sejk8q.py", line 1, in <module> n = list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s115992729
p02257
u963402991
1447735217
Python
Python3
py
Runtime Error
0
0
276
n = list(map(int,input().split()) def Is_prime(n): if n % 2 == 0: return False i = 3 while i < int(n ** (0.5))+ 1: if n % i == 0: return False return True count = 0 for j in n: if Is_prime(j): count += 1 print (count)
File "/tmp/tmprmb9c3x3/tmpouteefxu.py", line 1 n = list(map(int,input().split()) ^ SyntaxError: '(' was never closed
s115566593
p02257
u963402991
1447735365
Python
Python3
py
Runtime Error
0
0
286
N = input() n = [input() for i in range(N)] def Is_prime(n): if n % 2 == 0: return False i = 3 while i < int(n ** (0.5))+ 1: if n % i == 0: return False return True count = 0 for j in n: if Is_prime(j): count += 1 print (count)
Traceback (most recent call last): File "/tmp/tmpor66z1bs/tmpyivdkpqu.py", line 1, in <module> N = input() ^^^^^^^ EOFError: EOF when reading a line
s239947076
p02257
u963402991
1447735418
Python
Python3
py
Runtime Error
0
0
315
# -*- coding:utf-8 -*- N = int(input()) n = [input() for i in range(N)] def Is_prime(n): if n % 2 == 0: return False i = 3 while i < int(n ** (0.5))+ 1: if n % i == 0: return False return True count = 0 for j in n: if Is_prime(j): count += 1 print (count)
Traceback (most recent call last): File "/tmp/tmpqm0fotxg/tmp021scn2a.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s779070506
p02257
u069446126
1452340774
Python
Python3
py
Runtime Error
0
0
82
cond = map(raw_input().split()) a = cond[0] b = cond[1] print "(a*b) (a*2 + b*2)"
File "/tmp/tmpjs9w4zgk/tmp0xbghk51.py", line 5 print "(a*b) (a*2 + b*2)" ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s914895813
p02257
u313796116
1457788635
Python
Python3
py
Runtime Error
30
7672
229
prime = [0] * 10001;prime[0] = 1;prime[1] = 1;Count=0 for i in range(int(10001**.5)): if prime[i]:continue for j in range(i*i,10001,i):prime[j]=1 for _ in range(int(input())): if not(prime[int(input())]):Count+=1 print(Count)
Traceback (most recent call last): File "/tmp/tmptt4pgaxi/tmpehc664fs.py", line 6, in <module> for _ in range(int(input())): ^^^^^^^ EOFError: EOF when reading a line
s820687391
p02257
u994049982
1458604849
Python
Python
py
Runtime Error
0
0
105
a=map(int,raw_input().split()) a.sort() b=0 while a!=[]: b+=1 a=[i for i in a if a[i]%a[0]==0] print(b)
Traceback (most recent call last): File "/tmp/tmp1si31rp5/tmp5enbx1ax.py", line 1, in <module> a=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s925515817
p02257
u994049982
1458604902
Python
Python
py
Runtime Error
0
0
105
a=map(int,raw_input().split()) a.sort() b=0 while a!=[]: b+=1 a=[i for i in a if a[i]%a[0]!=0] print(b)
Traceback (most recent call last): File "/tmp/tmpsn01ew8y/tmpp9xelqsy.py", line 1, in <module> a=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s381828030
p02257
u994049982
1458605328
Python
Python
py
Runtime Error
0
0
154
a=map(int,raw_input().split()) a.sort() b=0 for i in a: t=True for I in range(2,int(a**0.5)+1): if i%I==0: t=False break if t: b+=1 print(b)
Traceback (most recent call last): File "/tmp/tmpavqzejmj/tmpe8wtbzty.py", line 1, in <module> a=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s173595688
p02257
u994049982
1458605369
Python
Python
py
Runtime Error
0
0
145
a=map(int,raw_input().split()) a.sort() b=0 for i in a: t=True for I in range(2,int(a**0.5)+1): if i%I==0: t=False if t: b+=1 print(b)
Traceback (most recent call last): File "/tmp/tmpohp_e69l/tmpbffi8y1f.py", line 1, in <module> a=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s719241288
p02257
u994049982
1458606088
Python
Python
py
Runtime Error
0
0
138
a=list(set(a)) b=0 for i in a: t=True for I in range(2,int(i**0.5)+1): if i%I==0: t=False if t: b+=1 print(b)
Traceback (most recent call last): File "/tmp/tmp_0m_sch7/tmponmbg0uz.py", line 1, in <module> a=list(set(a)) ^ NameError: name 'a' is not defined
s869222299
p02257
u994049982
1458607154
Python
Python3
py
Runtime Error
0
0
181
a=map(int,raw_input().split()) a=list(set(a)) b=0 for i in a: t=True for I in range(2,int(i**0.5)+1): if i%I==0: t=False if t: b+=1 print(b)
Traceback (most recent call last): File "/tmp/tmpst7zk8kv/tmp9rrzdzuq.py", line 1, in <module> a=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s234842924
p02257
u994049982
1458607189
Python
Python3
py
Runtime Error
0
0
180
a=map(int,raw_input().split()) a=list(set(a)) b=0 for i in a: t=True for I in range(2,int(i**0.5)+1): if i%I==0: t=False if t: b+=1 print b
File "/tmp/tmp4xbay_5q/tmpcvur3zr_.py", line 11 print b ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s896298887
p02257
u647766105
1464169920
Python
Python3
py
Runtime Error
30
7828
432
from operator import itemgetter def eratosthenes(n): table = [True] * (n + 1) table[0] = table[1] = True for i in range(2, int(round(pow(n, 0.5)))): if not table[i]: continue for j in range(i + i, n, i): table[j] = False return table if __name__ == "__main__": N = int(input()) f = itemgetter(*[int(input()) for _ in range(N)]) print(sum(f(eratosthenes(10000))))
Traceback (most recent call last): File "/tmp/tmpoghuhi3l/tmp6yh1cyu3.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s756854311
p02257
u647766105
1464169960
Python
Python3
py
Runtime Error
50
8484
433
from operator import itemgetter def eratosthenes(n): table = [True] * (n + 1) table[0] = table[1] = True for i in range(2, int(round(pow(n, 0.5)))): if not table[i]: continue for j in range(i + i, n, i): table[j] = False return table if __name__ == "__main__": N = int(input()) f = itemgetter(*[int(input()) for _ in range(N)]) print(sum(f(eratosthenes(100000))))
Traceback (most recent call last): File "/tmp/tmpdjqtygrj/tmp4sxg8y7m.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s248969658
p02257
u003309334
1464565284
Python
Python
py
Runtime Error
0
0
197
def isPrime(num): if num == 2: return 1 if num < 2 or num&1 == 0: return 0 if pow(2, num-1, num) == 1: return 1 n = input() s = 0 for i in xrange(n): s += isPrime(input()) print s
File "/tmp/tmpvb3sv5h6/tmpsxjtpynm.py", line 11 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s749072160
p02257
u935184340
1466254668
Python
Python3
py
Runtime Error
0
0
675
def composite(d,n,s): for a in (2,3,5,7): maybe_prime = False if pow(a,d,n) == 1: maybe_prime = True continue for i in range(s): if pow(a, 2**i * d, n) == n-1: maybe_prime = True break return not probably_prime return False def is_prime(n): if n==2: return True elif n%2==0: return False else: d,s = n-1, 0 while not d%2: d,s = d>>1,s+1 return not composite(d,n,s) r = [] n = int(input()) for i in range(n): n = int(input()) if is_prime(n): if n not in r: r.append(n) print(len(r))
Traceback (most recent call last): File "/tmp/tmp3a4_fz46/tmpod9zv602.py", line 25, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s209270821
p02257
u611490888
1468238786
Python
Python
py
Runtime Error
0
0
563
# -*- coding: utf-8 -*- import numpy as np def is_prime(number): # exclude even number if number == 2: return True elif number < 2 or number % 2 == 0: return False else: i = 3 while i <= np.sqrt(number): if number % i == 0: return False i += 2 return True if __name__ == '__main__': N = input() numbers = [input() for i in xrange(N)] count = 0 for i in xrange(len(numbers)): if is_prime(numbers[i]): count += 1 print count
File "/tmp/tmphsqh9lnz/tmpk60dz4zz.py", line 28 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s782857872
p02257
u611490888
1468238918
Python
Python
py
Runtime Error
0
0
563
# -*- coding: utf-8 -*- import numpy as np def is_prime(number): # exclude even number if number == 2: return True elif number < 2 or number % 2 == 0: return False else: i = 3 while i <= np.sqrt(number): if number % i == 0: return False i += 2 return True if __name__ == '__main__': N = input() numbers = [input() for i in xrange(N)] count = 0 for i in xrange(len(numbers)): if is_prime(numbers[i]): count += 1 print count
File "/tmp/tmpeiiki3kd/tmp_mxxpoxl.py", line 28 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s184128258
p02257
u496045719
1469373944
Python
Python3
py
Runtime Error
40
7880
688
import sys import math prime_numbers = [2, 3, 5, 7] def prime_numbers_under(num): global prime_numbers if max(prime_numbers) > num: return list(filter(lambda x: x <= num, prime_numbers)) primes = prime_numbers_under(num - 1) for i in primes: if num % i == 0: break else: primes.append(num) prime_numbers = primes return prime_numbers def main(): amount = 0 length = int(input()) for _ in range(0, length): i = int(input()) check_max = math.floor(math.sqrt(i)) for j in prime_numbers_under(check_max): if i % j == 0: break else: amount += 1 print(amount) return 0 if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmpe9ergzb5/tmpt9jlakjv.py", line 42, in <module> main() File "/tmp/tmpe9ergzb5/tmpt9jlakjv.py", line 27, in main length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s959494955
p02257
u496045719
1469378785
Python
Python3
py
Runtime Error
0
0
475
def is_prime(n): if n in [2, 3, 5, 7]: return True elif 0 in [n%2, n%3, n%5, n%7]: return False else: check_max = math.floor(math.sqrl(n)) for i in range(2, check_max): if n % i == 0: return False else: return True def main(): primes = [] length = int(input()) for _ in range(0, length): n = int(input()) if is_prime(n): primes.append(n) print(len(primes)) return 0 if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp9u_9jem4/tmp7_8n5wk8.py", line 27, in <module> main() File "/tmp/tmp9u_9jem4/tmp7_8n5wk8.py", line 16, in main length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s551462131
p02257
u603356762
1470496294
Python
Python3
py
Runtime Error
0
0
418
mport math import numpy as np n = int(input()) A = [int(input()) for x in range(n)] A_max = max(A) #A_max?????§????´???°??¨??????????????? p_table = list(np.arange(2,A_max+1)) p_table for p in p_table: j=2 while 0 < j*p-2 < len(p_table): p_table[j*p-2] = 0 j += 1 p_table = [x for x in p_table if x != 0] count = 0 for a in A: if a in p_table: count += 1 print(count)
File "/tmp/tmp927vbq8r/tmpxc5b9p7i.py", line 1 mport math ^^^^ SyntaxError: invalid syntax
s703357483
p02257
u603356762
1470496452
Python
Python3
py
Runtime Error
0
0
419
import math import numpy as np n = int(input()) A = [int(input()) for x in range(n)] A_max = max(A) #A_max?????§????´???°??¨??????????????? p_table = list(np.arange(2,A_max+1)) p_table for p in p_table: j=2 while 0 < j*p-2 < len(p_table): p_table[j*p-2] = 0 j += 1 p_table = [x for x in p_table if x != 0] count = 0 for a in A: if a in p_table: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpqmufzvf9/tmpefli58ax.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s650631655
p02257
u603356762
1470496516
Python
Python3
py
Runtime Error
0
0
375
import math import numpy as np n = int(input()) A = [int(input()) for x in range(n)] A_max = max(A) p_table = list(np.arange(2,A_max+1)) p_table for p in p_table: j=2 while 0 < j*p-2 < len(p_table): p_table[j*p-2] = 0 j += 1 p_table = [x for x in p_table if x != 0] count = 0 for a in A: if a in p_table: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmp164kvfkw/tmp96pd2ox1.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s934028245
p02257
u603356762
1470496539
Python
Python3
py
Runtime Error
0
0
375
import math import numpy as np n = int(input()) A = [int(input()) for x in range(n)] A_max = max(A) p_table = list(np.arange(2,A_max+1)) p_table for p in p_table: j=2 while 0 < j*p-2 < len(p_table): p_table[j*p-2] = 0 j += 1 p_table = [x for x in p_table if x != 0] count = 0 for a in A: if a in p_table: count += 1 print("aho")
Traceback (most recent call last): File "/tmp/tmpij6rlsi7/tmpvei4chff.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s926970869
p02257
u500396695
1476724970
Python
Python3
py
Runtime Error
0
0
247
for i in range(0, N): j = A[i] - 2 if j == 0 or j == 1: counter += 1 else: while j > 1: if A[i] % j == 0: break else: j -= 1 else: counter += 1
Traceback (most recent call last): File "/tmp/tmplktu6ak7/tmpn_goo61x.py", line 1, in <module> for i in range(0, N): ^ NameError: name 'N' is not defined
s185334215
p02257
u831244171
1477800304
Python
Python
py
Runtime Error
0
0
270
import math n = input() c = 0 for i in range(int(n)): x = int(input()) if x == 1: x = 0 for j in range(2,math.floor(math.sqrt(float(x)))+ 1): if x % j == 0: x = 0 break if x != 0: c += 1 print(c)
Traceback (most recent call last): File "/tmp/tmpz7t5ljod/tmp861ux98l.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s414829867
p02257
u831244171
1477800346
Python
Python
py
Runtime Error
0
0
252
import math n = input() c = 0 for i in range(n): x = input() if x == 1: x = 0 for j in range(2,math.floor(math.sqrt(x))+ 1): if x % j == 0: x = 0 break if x != 0: c += 1 print(c)
Traceback (most recent call last): File "/tmp/tmpxcixx1bf/tmp73l38rzp.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s565983059
p02257
u831244171
1477800402
Python
Python
py
Runtime Error
0
0
244
import math n = input() c = 0 for i in range(n): x = input() if x == 1: x = 0 for j in range(2,math.floor(math.sqrt(x))+ 1): if x % j == 0: x = 0 break if x != 0: c += 1 print(c)
Traceback (most recent call last): File "/tmp/tmpsnv_6h6u/tmpvh5920w3.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s771868362
p02257
u831244171
1477800419
Python
Python
py
Runtime Error
0
0
251
import math n = input() c = 0 for i in range(n): x = input() if x == 1: x = 0 for j in range(2,math.floor(math.sqrt(float(x)))+ 1): if x % j == 0: x = 0 break if x != 0: c += 1 print(c)
Traceback (most recent call last): File "/tmp/tmpp40evxfa/tmpcpxei3ka.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s194465468
p02257
u428229577
1479267866
Python
Python3
py
Runtime Error
160
55352
516
from math import sqrt def isprime(farm, prime): first = min(farm) prime.append(first) maxfarm = max(farm) dellst = range(first, maxfarm+1, first) farm = set(farm - set(dellst)) if len(farm) > 0 and sqrt(maxfarm) > first: return isprime(farm, prime) else: return prime.extend(farm) n = int(input()) inlst = [] for i in range(n): inlst.append(int(input())) farm = set(range(2, max(inlst)+1, 1)) prime = [1] if len(farm) > 0: isprime(farm, prime) out = list(set(inlst) & set(prime)) print(len(out))
Traceback (most recent call last): File "/tmp/tmpvkn7hhi6/tmp6fd8rddg.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s952143537
p02257
u428229577
1479268017
Python
Python3
py
Runtime Error
150
49768
518
from math import sqrt def isprime(farm, prime): first = min(farm) prime.append(first) maxfarm = max(farm) dellst = range(first, maxfarm+1, first) farm = set(farm - set(dellst)) if len(farm) > 0 and sqrt(maxfarm) > first: return isprime(farm, prime) else: return prime.extend(farm) n = int(input()) inlst = [] for i in range(n): inlst.append(int(input())) farm = set(range(3, max(inlst)+1, 2)) prime = [1,2] if len(farm) > 0: isprime(farm, prime) out = list(set(inlst) & set(prime)) print(len(out))
Traceback (most recent call last): File "/tmp/tmpzohhtixm/tmp26r_l3s0.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s389138251
p02257
u428229577
1479274383
Python
Python3
py
Runtime Error
30
7900
479
from math import sqrt def isprime(inlst, i, sq): inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst)) if sq >= i: return isprime(inlst, i +2, sq) else: return inlst n = int(input()) inlst = [] twonum = 0 for i in range(n): inlst.append(int(input())) if inlst[i] == 2: twonum += 1 inlst = list(filter(lambda x: x % 2 is not 0, inlst)) i = 3 maxin = max(inlst) if len(inlst) > 0: inlst = isprime(inlst, i, int(sqrt(maxin)) + 1) print(len(inlst) + twonum)
/tmp/tmph8c4hotj/tmp8l38c6yf.py:3: SyntaxWarning: "is not" with a literal. Did you mean "!="? inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst)) /tmp/tmph8c4hotj/tmp8l38c6yf.py:17: SyntaxWarning: "is not" with a literal. Did you mean "!="? inlst = list(filter(lambda x: x % 2 is not 0, inlst)) Traceback (most recent call last): File "/tmp/tmph8c4hotj/tmp8l38c6yf.py", line 9, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s393715556
p02257
u428229577
1479276383
Python
Python3
py
Runtime Error
30
7896
446
from math import sqrt def isprime(inlst, i, sq): inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst)) if sq >= i: return isprime(inlst, i +2, sq) else: return inlst n = int(input()) inlst = [] twonum = 0 for i in range(n): inlst.append(int(input())) inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst)) i = 3 maxin = max(inlst) if len(inlst) > 0: inlst = isprime(inlst, i, int(sqrt(maxin)) + 1) print(len(inlst))
/tmp/tmpim9u6gvd/tmpvciht03z.py:3: SyntaxWarning: "is not" with a literal. Did you mean "!="? inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst)) /tmp/tmpim9u6gvd/tmpvciht03z.py:15: SyntaxWarning: "is not" with a literal. Did you mean "!="? inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst)) /tmp/tmpim9u6gvd/tmpvciht03z.py:15: SyntaxWarning: "is" with a literal. Did you mean "=="? inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst)) Traceback (most recent call last): File "/tmp/tmpim9u6gvd/tmpvciht03z.py", line 9, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s900103188
p02257
u428229577
1479278988
Python
Python3
py
Runtime Error
20
7972
429
from math import sqrt def isprime(inlst, i, sq): inlst = [x for x in inlst if x%i > 0 or x == i] if sq >= i: return isprime(inlst, i +2, sq) else: return inlst n = int(input()) inlst = [] for i in range(n): inlst.append(int(input())) inlst = [x for x in inlst if x%2 > 0 or x == 2] i = 3 maxin = max(inlst) if len(inlst) > 0: inlst = isprime(inlst, i, int(sqrt(maxin)) + 1) print(len(inlst))
Traceback (most recent call last): File "/tmp/tmpsdsw24bh/tmp584om9ub.py", line 9, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s701348506
p02257
u475480520
1483542374
Python
Python
py
Runtime Error
0
0
425
def isPrimeNum(x): # for speed up if x == 2: return True if x % 2 == 0: return False # check by only odd number i = 3 while i < x: if x % i == 0 or x % (x - i - 2) == 0: return False i += 2 return True # input n = int(raw_input()) if n < 1 or n > 10000: exit() count = 0 for i in range(0, n): e = int(raw_input()) if e < 2 or e > 1000000000: exit() if isPrimeNum(e): count += 1 print count
File "/tmp/tmpeupnpx_5/tmp7w1xs9wk.py", line 32 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s193388070
p02257
u656153606
1485075202
Python
Python3
py
Runtime Error
0
0
258
n = int(input()) c = 0 def devisor(n): if n == 2: return 1 else: if n < 2 or n % 2 == 0: return 0 elif pow(2,n-1,n) == 1: return 1 for i in range(n): x = int(input()) c += devisor(x) print(c)
Traceback (most recent call last): File "/tmp/tmpwm5_txyx/tmpk4d2ut26.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s822923101
p02257
u301461168
1488620145
Python
Python3
py
Runtime Error
380
15156
434
import math num_max = 1000000 isPrimeNum = [True for i in range(0,num_max)] isPrimeNum[0] == False isPrimeNum[1] == False for i in range(2, int(math.sqrt(num_max))): if isPrimeNum[i] == True: for j in range (i**2, num_max, i): isPrimeNum[j] = False num_len = int(input()) cnt = 0 for i in range(num_len): num = int(input()) if isPrimeNum[num]==True: cnt = cnt + 1 print(str(cnt))
Traceback (most recent call last): File "/tmp/tmp_d52soiz/tmpgp3wie4w.py", line 15, in <module> num_len = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s026600103
p02257
u301461168
1488620180
Python
Python3
py
Runtime Error
70
8288
433
import math num_max = 100000 isPrimeNum = [True for i in range(0,num_max)] isPrimeNum[0] == False isPrimeNum[1] == False for i in range(2, int(math.sqrt(num_max))): if isPrimeNum[i] == True: for j in range (i**2, num_max, i): isPrimeNum[j] = False num_len = int(input()) cnt = 0 for i in range(num_len): num = int(input()) if isPrimeNum[num]==True: cnt = cnt + 1 print(str(cnt))
Traceback (most recent call last): File "/tmp/tmp0jhu0p0l/tmpwkv1lhm6.py", line 15, in <module> num_len = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s230692895
p02257
u301461168
1488620571
Python
Python3
py
Runtime Error
30
7696
431
import math num_max = 1000 isPrimeNum = [True for i in range(0,num_max)] isPrimeNum[0] == False isPrimeNum[1] == False for i in range(2, int(math.sqrt(num_max))): if isPrimeNum[i] == True: for j in range (i**2, num_max, i): isPrimeNum[j] = False num_len = int(input()) cnt = 0 for i in range(num_len): num = int(input()) if isPrimeNum[num]==True: cnt = cnt + 1 print(str(cnt))
Traceback (most recent call last): File "/tmp/tmpx0s13012/tmp7ywhg0hb.py", line 15, in <module> num_len = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s468605230
p02257
u301461168
1488620687
Python
Python3
py
Runtime Error
80
8356
435
import math num_max = 100000 isPrimeNum = [True for i in range(0,num_max+1)] isPrimeNum[0] == False isPrimeNum[1] == False for i in range(2, int(math.sqrt(num_max))): if isPrimeNum[i] == True: for j in range (i**2, num_max, i): isPrimeNum[j] = False num_len = int(input()) cnt = 0 for i in range(num_len): num = int(input()) if isPrimeNum[num]==True: cnt = cnt + 1 print(str(cnt))
Traceback (most recent call last): File "/tmp/tmp8vnafgu6/tmpyafu2d42.py", line 15, in <module> num_len = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s556779042
p02257
u301461168
1488621111
Python
Python3
py
Runtime Error
3670
85392
438
import math num_max = 10000000 isPrimeNum = [True for i in range(0,num_max+1)] isPrimeNum[0] == False isPrimeNum[1] == False for i in range(2, int(math.sqrt(num_max))+1): if isPrimeNum[i] == True: for j in range (i**2, num_max, i): isPrimeNum[j] = False num_len = int(input()) cnt = 0 for i in range(num_len): num = int(input()) if isPrimeNum[num]==True: cnt = cnt + 1 print(str(cnt))
Traceback (most recent call last): File "/tmp/tmpnmbwwgkg/tmpemtfe7xs.py", line 15, in <module> num_len = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s036014031
p02257
u072398496
1489028521
Python
Python
py
Runtime Error
0
0
187
import math n=input() A=0 def is_prime(m): for i in range(2, int(math.sqrt(m))+1): if m%i==0: return False return True for i in range(n): k=input() if is_prime(k): A+=1 print A
File "/tmp/tmptu1es6gf/tmpgkt5rfv3.py", line 12 A+=1 ^ IndentationError: expected an indented block after 'if' statement on line 11
s201647353
p02257
u130834228
1489324425
Python
Python3
py
Runtime Error
0
0
334
import math def prime(n): for i in range(2, int(n/2)+1): if n % i == 0: return False return True num_prime = [] k = 0 while True: n = input() if n == '\x04': break if prime(int(n)): if not int(n) in num_prime: k += 1 num_prime.append(int(n)) print(k)
Traceback (most recent call last): File "/tmp/tmpqss_7b8l/tmpjct3yjh2.py", line 12, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s791856726
p02257
u130834228
1489325295
Python
Python3
py
Runtime Error
0
0
347
import math def prime(n): for i in range(2, int(math.sqrt(n))+1: if n % i == 0: return False return True num_prime = [] k = 0 while True: try: n = input() except: break if prime(int(n)): if not int(n) in num_prime: k += 1 num_prime.append(int(n)) print(k)
File "/tmp/tmpjvfwtv1h/tmpb8kuq5_g.py", line 4 for i in range(2, int(math.sqrt(n))+1: ^ SyntaxError: invalid syntax
s843680301
p02257
u470964735
1492012437
Python
Python3
py
Runtime Error
0
0
629
import math p = [2] def isprime(x): if x == 2: return True if x == 3: return True if max(p) < x**0.5: for j in range(max(p), math.floor(x**0.5) + 1): if all([j % k != 0 for k in p]): p.append(j) i = 0 while i <= len(p)-1: if x%p[i] == 0: return False if p[i] > x**0.5: break; i += 1 return True n = int(input()) res = 0 for i in range(n): k = int(input()) if isprime(k): res += 1 print(res, p) for i in range(n): k = int(input()) if isprime(k): res += 1 print(res)
Traceback (most recent call last): File "/tmp/tmph5upvazb/tmpwapn_98r.py", line 24, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s477432116
p02257
u286589639
1493276275
Python
Python3
py
Runtime Error
0
0
291
import sys import math def isprime(n): ans = 1 for i in range(2, n): x = i y = n % i if math.gcd(x, y) != 1: ans = 0 break return ans n = int(input()) p = 0 for i in map(int, sys.stdin.readlines()): p += isprime(i) print(p)
Traceback (most recent call last): File "/tmp/tmpp79m21y9/tmp4s3wtx09.py", line 15, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s536028177
p02257
u939814144
1494906632
Python
Python3
py
Runtime Error
0
0
447
def is_prime(x): if x == 2: return True if (x == 1) or (x % 2 == 0): return False for i in range(3, sqrt(x), 2): if x % i == 0: return False return True if __name__ == '__main__': element_number = int(input()) input_array = [int(input()) for i in range(element_number)] output = 0 for x in input_array: if(is_prime(x)): output += 1 print(output)
Traceback (most recent call last): File "/tmp/tmpisboz6va/tmpjh9p67ug.py", line 15, in <module> element_number = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s537528224
p02257
u939814144
1494910581
Python
Python3
py
Runtime Error
0
0
434
import math def is_prime(x): if x == 2: return True if (x == 1) or (x % 2 == 0): return False for i in range(3, math.ceil(math.sqrt(x))+1, 2): if x % i == 0: return False return True if __name__ == '__main__': element_number = int(input()) output = 0 for x in map(int, sys.stdin.readlines()): if(is_prime(x)): output += 1 print(output)
Traceback (most recent call last): File "/tmp/tmp8vjugyri/tmp89ymp3a4.py", line 17, in <module> element_number = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s558418482
p02257
u821624310
1496729158
Python
Python3
py
Runtime Error
0
0
371
import math cnt = 0 N = int(input()) for i in range(N): n = int(input()) if n % 2: area = round(math.sqrt(n)) prime_ng = 0 for i in range(2, area + 1): if n % i == 0: prime_ng = 1 break else: if prime_ng == 0: cnt += 1 elif n == 2: cnt += 1 print(cnt)
File "/tmp/tmpmpwrlieb/tmplxeo23xx.py", line 14 if prime_ng == 0: IndentationError: expected an indented block after 'else' statement on line 13
s270787534
p02257
u582608581
1499352127
Python
Python3
py
Runtime Error
0
0
309
import math def is_prime(num): prime = True for i in range(2,int(math.sqrt(num))+1): if num%i == 0: prime = False break return prime num_set = set() try: while True: num_set.add(eval(input())) except EOFError: count = 0 for x in num_set: count = count + (1 if is_prime(x) else 0) print(count)
File "/tmp/tmp3vvu275r/tmpvrgjbw17.py", line 16 count = 0 ^ IndentationError: expected an indented block after 'except' statement on line 15
s029919083
p02257
u029473859
1502760955
Python
Python3
py
Runtime Error
0
0
93
n = list(map(int,input().split())) print(int(n[0]/n[1]), n[0]%n[1], "{:f}".format(n[0]/n[1]))
Traceback (most recent call last): File "/tmp/tmpnzf7nrgr/tmpy6tonvpq.py", line 1, in <module> n = list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s252672847
p02257
u283452598
1503218718
Python
Python3
py
Runtime Error
0
0
337
def division(x,y): if y == 0: return x return division(y, x%y) def checker(x): for i in range(2,x//2+1): v = division(x,i) if v > 1 : return False else: return True cnt=0 q=int(input()) for i in range(q): o=checker(int(input)) if o: cnt+=1 print(cnt)
Traceback (most recent call last): File "/tmp/tmp8t1tu2on/tmp_ny0dg_7.py", line 15, in <module> q=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s211932138
p02257
u283452598
1503219610
Python
Python3
py
Runtime Error
0
0
262
def checker(x): if x < 2 or x%2==0: return False for i in range(2,x**0.5+1): if x % i ==0: return False return True cnt=0 q=int(input()) for _ in range(q): v=int(input()) if checker(v): cnt += 1 print(cnt)
Traceback (most recent call last): File "/tmp/tmpwwni431e/tmp3juokki1.py", line 10, in <module> q=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s954544851
p02257
u283452598
1503219687
Python
Python3
py
Runtime Error
0
0
269
def checker(x): if x < 2 or x % 2 == 0 : return False for i in range(2,x**0.5+1): if x % i == 0 : return False return True cnt=0 q=int(input()) for _ in range(q): v=int(input()) if checker(v): cnt += 1 print(cnt)
Traceback (most recent call last): File "/tmp/tmp1tf42mv6/tmpidmnou69.py", line 10, in <module> q=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s235056560
p02257
u972637506
1505795669
Python
Python3
py
Runtime Error
0
0
393
from math import ceil, sqrt def f(n): if n == 2: return 1 if n % 2 == 0: return 0 for i in range(3, ceil(sqrt(n)), 2): if pred(n, i): return 0 else: return 1 def g(n): d = {} for _ in range(n): i = int(input()) if not (i in d): d[i] = f(i) yield d[i] n = int(input()) print(sum(g(n)))
Traceback (most recent call last): File "/tmp/tmp9r35pul2/tmpiz4vb3qx.py", line 24, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s766820641
p02257
u024715419
1507268539
Python
Python3
py
Runtime Error
0
0
318
n = int(input()) n_p = 0 for i in range(n): a = int(input()) if a == 2: n_p += 1 continue elif a % 2 == 0: continue else: j = 3 while j =< math.sqrt(a) if a%j == 0: break j += 2 else: n_p += 1 print n_p
File "/tmp/tmp7u4p8ko1/tmp27pkepte.py", line 12 while j =< math.sqrt(a) ^ SyntaxError: invalid syntax
s700320900
p02257
u576398884
1508200571
Python
Python3
py
Runtime Error
30
7756
312
import math def hurui(a): ret = [True for i in range(a+1)] for i in range(2, int(math.sqrt(a))+2): for j in range(i*2, a+1, i): ret[j] = False return ret n = int(input()) l = hurui(10000) ans = 0 for i in range(n): a = int(input()) if l[a]: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmphmv795li/tmp62xd699t.py", line 11, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s431175043
p02257
u576398884
1508202918
Python
Python3
py
Runtime Error
0
0
225
import math ans = 0 N = int(input()) for i in range(N): a = int(input()) if a == 2: ans += 1 elif a%2 == 0: continue else: if math.pow(2, a-1, a) == 1: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpw41hs84_/tmpl6y_h__w.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s700722173
p02257
u576398884
1508203011
Python
Python3
py
Runtime Error
0
0
225
import math ans = 0 N = int(input()) for i in range(N): a = int(input()) if a == 2: ans += 1 elif a%2 == 0: continue else: if math.pow(2, a-1, a) == 1: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpcmp0xj18/tmpv6nhwu0z.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s583923545
p02257
u626266743
1508897532
Python
Python3
py
Runtime Error
0
0
143
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x % i == 0): break else: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpl7pxahh1/tmpr9zx462q.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s237873650
p02257
u424457654
1508898943
Python
Python3
py
Runtime Error
0
0
220
n = int(input()) count = 0 for i in range(n): x = int(input()) for j in range(x - 1): if x == 2: count += 1 elif x % 2 == 0: continue else: if x % j != 0: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpn0n2xh6h/tmp3fkzope8.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s694858893
p02257
u424457654
1508898962
Python
Python3
py
Runtime Error
0
0
216
n = int(input()) count = 0 for i in range(n): x = int(input()) for j in range(x): if x == 2: count += 1 elif x % 2 == 0: continue else: if x % j != 0: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpmrqi19g1/tmpbhl1utc7.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s166538844
p02257
u626266743
1508898980
Python
Python3
py
Runtime Error
0
0
251
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpen8vjbo9/tmp0z7ut2kf.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s690051870
p02257
u626266743
1508899082
Python
Python3
py
Runtime Error
0
0
273
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 j = j + 1 print(count)
Traceback (most recent call last): File "/tmp/tmpceefsmtm/tmpip2nqg09.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s060849227
p02257
u626266743
1508899112
Python
Python3
py
Runtime Error
0
0
273
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 j = j + 1 print(count)
Traceback (most recent call last): File "/tmp/tmplfvnapno/tmpvz6m6524.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s036183791
p02257
u626266743
1508899367
Python
Python3
py
Runtime Error
0
0
303
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x < 2): break if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 j = j + 1 print(count)
Traceback (most recent call last): File "/tmp/tmpdmw6ncfs/tmpjd3fnh5l.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s186162227
p02257
u626266743
1508899469
Python
Python3
py
Runtime Error
0
0
303
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x < 2): break if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 j = j + 2 print(count)
Traceback (most recent call last): File "/tmp/tmpyrksil4x/tmp8t2cjc64.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s489720416
p02257
u626266743
1508899493
Python
Python3
py
Runtime Error
0
0
300
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x < 2): break if (x == 2): count += 1 else: while (j * j <= x): if (x % j == 0): break else: count += 1 j += 2 print(count)
Traceback (most recent call last): File "/tmp/tmph8ys7ut3/tmp97gixfat.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s172629320
p02257
u626266743
1508899913
Python
Python3
py
Runtime Error
0
0
229
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else if (x % 2 == 0): continue else: if (pow(2, x - 1, 1) == 0): count += 1 print(count)
File "/tmp/tmp8nlztnlo/tmpdy4jgk7b.py", line 7 else if (x % 2 == 0): ^^ SyntaxError: expected ':'
s678856881
p02257
u626266743
1508899924
Python
Python3
py
Runtime Error
0
0
229
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else if (x % 2 == 0): continue else: if (pow(2, x - 1, x) == 0): count += 1 print(count)
File "/tmp/tmpzxtxbb2x/tmp6tsz01z_.py", line 7 else if (x % 2 == 0): ^^ SyntaxError: expected ':'
s746904729
p02257
u626266743
1508900010
Python
Python3
py
Runtime Error
0
0
229
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else if (x % 2 == 0): continue else: if (pow(2, x - 1, x) == 1): count += 1 print(count)
File "/tmp/tmpqus14r81/tmpfmncj7zn.py", line 7 else if (x % 2 == 0): ^^ SyntaxError: expected ':'
s154928601
p02257
u626266743
1508900035
Python
Python3
py
Runtime Error
0
0
229
n = int(input()) count = 0 for i in range(n): x = int(input()) if (x == 2): count += 1 else if (x % 2 == 0): continue else: if (pow(2, x - 1, x) == 1): count += 1 print(count)
File "/tmp/tmpygo_vf73/tmpwzf6na78.py", line 7 else if (x % 2 == 0): ^^ SyntaxError: expected ':'
s246147624
p02257
u626266743
1508900099
Python
Python3
py
Runtime Error
0
0
229
n = int(input()) count = 0 for j in range(n): x = int(input()) if (x == 2): count += 1 else if (x % 2 == 0): continue else: if (pow(2, x - 1, x) == 1): count += 1 print(count)
File "/tmp/tmp15xlcc36/tmp6fypahmc.py", line 7 else if (x % 2 == 0): ^^ SyntaxError: expected ':'
s086718215
p02257
u409699893
1510897302
Python
Python3
py
Runtime Error
0
0
298
def isprime(number): if number == 2 or 2 ** (number -1) % number == 1: return 1 else: return 0 def countPrime(number,count): if isprime(number)== 1: count +=1 return count n = int(input()) c = 0 for i in range(n): c = countPrime(i,c) print (c)
Traceback (most recent call last): File "/tmp/tmp78nk592g/tmphd4birgw.py", line 12, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s789562572
p02257
u987649781
1512054777
Python
Python3
py
Runtime Error
0
0
738
import sys def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with 3 and only needs to go up # the square root of n for all odd numbers for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True max = sys.stdin.readline() answer = [] for x in [0..max-1]: n = sys.stdin.readline() if isprime(n): answer.append(n) for x in answer: print(x + " ")
Traceback (most recent call last): File "/tmp/tmpei5bbjge/tmpp5032lhw.py", line 34, in <module> for x in [0..max-1]: ^^^^^^ AttributeError: 'float' object has no attribute 'max'
s937861933
p02257
u987649781
1512054905
Python
Python3
py
Runtime Error
0
0
726
import sys def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with 3 and only needs to go up # the square root of n for all odd numbers for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True max = sys.stdin.readline() answer = [] for x in [0..max-1]: n = sys.stdin.readline() if isprime(n): answer.append(n) print(' '.join(answer))
Traceback (most recent call last): File "/tmp/tmpf05oawon/tmp2w0r0zwm.py", line 34, in <module> for x in [0..max-1]: ^^^^^^ AttributeError: 'float' object has no attribute 'max'
s281875692
p02257
u987649781
1512055054
Python
Python3
py
Runtime Error
0
0
726
import sys def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with 3 and only needs to go up # the square root of n for all odd numbers for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True max = sys.stdin.readline() answer = [] for x in range(max): n = sys.stdin.readline() if isprime(n): answer.append(n) print(' '.join(answer))
Traceback (most recent call last): File "/tmp/tmpbx29t9tl/tmpnutlfxg7.py", line 34, in <module> for x in range(max): ^^^^^^^^^^ TypeError: 'str' object cannot be interpreted as an integer
s275603896
p02257
u987649781
1512055133
Python
Python3
py
Runtime Error
0
0
731
import sys def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with 3 and only needs to go up # the square root of n for all odd numbers for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True max = sys.stdin.readline() answer = [] for x in range(max): n = sys.stdin.readline() if isprime(int(n)): answer.append(n) print(' '.join(answer))
Traceback (most recent call last): File "/tmp/tmpcj5mx1in/tmp98npxgxg.py", line 34, in <module> for x in range(max): ^^^^^^^^^^ TypeError: 'str' object cannot be interpreted as an integer
s685240577
p02257
u987649781
1512055148
Python
Python
py
Runtime Error
0
0
731
import sys def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with 3 and only needs to go up # the square root of n for all odd numbers for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True max = sys.stdin.readline() answer = [] for x in range(max): n = sys.stdin.readline() if isprime(int(n)): answer.append(n) print(' '.join(answer))
Traceback (most recent call last): File "/tmp/tmp38rc2cpb/tmp6xfzac4u.py", line 34, in <module> for x in range(max): ^^^^^^^^^^ TypeError: 'str' object cannot be interpreted as an integer
s653858175
p02257
u424041287
1512113409
Python
Python3
py
Runtime Error
0
0
339
def isPrime(x): if x == 2: return True elif (x < 2) or (x % 2 == 0): return False else: i = 3 while i <= x**(1/2): if x % i: return False i += 2 return True t = 0 for i in range(int(input())): if inPrime(int(input())): t += 1 print(t)
Traceback (most recent call last): File "/tmp/tmp0lc_n0hq/tmpxn4l0hfv.py", line 15, in <module> for i in range(int(input())): ^^^^^^^ EOFError: EOF when reading a line
s315636317
p02257
u150984829
1513673215
Python
Python3
py
Runtime Error
0
0
127
def p(n): for i in range(2,x//2): if x%i==0:return 0 return 1 n=int(input()) print(sum([p(int(input()))for _ in range(n)]))
Traceback (most recent call last): File "/tmp/tmpa8h7tusu/tmp5m7hw5rm.py", line 5, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s955131002
p02257
u972731768
1514587433
Python
Python3
py
Runtime Error
0
0
189
import math N = int(input()) A = [int(input()) for i in range(N)] c=0 for i in range(N): x=abs(A[i]) if x==2:c+=1 if x<2 or x&1==0:continue if pow(1,x-1,x)==1 c+=1 print(c)
File "/tmp/tmpx1nxiz7_/tmpxlvgtjij.py", line 9 if pow(1,x-1,x)==1 c+=1 ^ SyntaxError: invalid syntax
s594902470
p02257
u972731768
1514589490
Python
Python3
py
Runtime Error
0
0
204
def is_prime(x): if x==2: return 1 elif x&1==0: return 0 else: return pow(2,x-1,x)==1 N = int(input()) for i in range(N): n=int(input()) c+=is_prime(n) print(c)
Traceback (most recent call last): File "/tmp/tmpau66crfb/tmpm8uxiazk.py", line 8, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s950898459
p02257
u972731768
1514589674
Python
Python3
py
Runtime Error
0
0
233
def is_prime(x): if x==2: return 1 elif x&1==0: return 0 elif pow(2,x-1,x)==1: return 1 else: return 0 N = int(input()) for i in range(N): n=int(input()) c+=is_prime(n) print(c)
Traceback (most recent call last): File "/tmp/tmpl1gnvie3/tmpff64hn9v.py", line 10, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s061138588
p02257
u009288816
1515074540
Python
Python
py
Runtime Error
10
4672
397
import sys def is_prime(x,y): if(y >= x-1): return 1 elif(x % y == 0): return 0 return 1 and is_prime(x,y+2) a = "" l = [] count = 0 for input in sys.stdin: a += input l = sorted(set(a.split())) for input in l: if(int(input) > 2 and int(input) % 2 != 0 and is_prime(int(input),3)): count += 1 elif(int(input) == 2): count += 1 print count
File "/tmp/tmpd60yxqc2/tmpmk5c695b.py", line 21 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s833516070
p02257
u839008951
1516274882
Python
Python3
py
Runtime Error
20
5644
365
import sys count = 0 inarr = 10001 * [False] for line in sys.stdin: n = int(line) inarr[n] = True if inarr[2]: count += 1 for n in range(3, 10001): if not inarr[n]: continue jdg = True for i in range(2, n): if n % i == 0: jdg = False break if jdg: count += 1 print(count)
0
s296748523
p02257
u884342371
1516513087
Python
Python3
py
Runtime Error
0
0
210
n = input() cnt = 0 for i in range(0, n): x = input() if (x > 1) : for j in range(2, x): if (x%j == 0): break if (j== x-1): cnt = cnt + 1 if (x == 2): cnt = cnt + 1 print(cnt)
Traceback (most recent call last): File "/tmp/tmp33u81t_1/tmp2rldjqdh.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s777854637
p02257
u150984829
1516617255
Python
Python3
py
Runtime Error
0
0
79
for _ in[0]*int(input()): x=int(input()) if 2 in[x,pow(2,x,x)]:c+=1 print(c)
Traceback (most recent call last): File "/tmp/tmp664bp3gw/tmpfv5y23e9.py", line 1, in <module> for _ in[0]*int(input()): ^^^^^^^ EOFError: EOF when reading a line
s306963537
p02257
u197670577
1518092255
Python
Python
py
Runtime Error
0
0
294
import math import sys def is_prime(x): if x==1: return 0 if x==2: return 1 n = 3 while n <= math.sqrt(x): if x % n == 0: return 1 n += 2 return 1 count = 0 for line in sys.stdin: x = int(raw_input()) count += is_prime(x) print count ~
File "/tmp/tmpjq3jgf0d/tmpohflj_qq.py", line 18 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s163405808
p02257
u608789460
1518805825
Python
Python3
py
Runtime Error
0
0
212
n=int(input()) nums=[] for i in range(n): nums.append(int(input())) count=0 for i in range(n): for j in range(2,int(sqrt(nums[i])+1)): if nums[i]%j==0: break count+=1 print(count)
Traceback (most recent call last): File "/tmp/tmps5uxiu2r/tmpr5plwkv1.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s778620405
p02257
u650712316
1519273695
Python
Python3
py
Runtime Error
0
0
457
isprime :: Int -> Bool isprime 1 = False isprime 2 = True isprime n = not $ or (map ((0==).(mod n)) [2..ceil]) where ceil = ceiling (sqrt (fromIntegral n)) getNLines :: Int -> IO [String] getNLines n = do ans <- sequence $ take n (repeat getLine) return ans main = do n <- getLine >>= return . read numbers <- getNLines n let integers = map read numbers print $ foldl (\acc x -> if isprime x then acc+1 else acc) 0 integers
File "/tmp/tmpf06kpuwb/tmpt1sugpzl.py", line 1 isprime :: Int -> Bool ^ SyntaxError: invalid syntax
s748814328
p02257
u150984829
1519781456
Python
Python3
py
Runtime Error
0
0
82
import sys input() print(len(1 for x in map(int,sys.stdin)if 2 in[x,pow(2,x,x)]))
Traceback (most recent call last): File "/tmp/tmpl5tfe8l5/tmpdlzcghim.py", line 2, in <module> input() EOFError: EOF when reading a line
s515216950
p02257
u581154076
1520087374
Python
Python3
py
Runtime Error
0
0
383
def main2(): n = 6 alist = [2, 3, 4, 5, 6, 7] print(alist) def is_prime(n): if n == 2: return True if n <= 1 or n % 2 == 0: return False n = ceil(sqrt(n)) for i in range(2, n): if n % i == 0: return False return True print(sum([is_prime(n) for n in alist])) main2()
Traceback (most recent call last): File "/tmp/tmpmawec9cu/tmpopqot5t_.py", line 21, in <module> main2() File "/tmp/tmpmawec9cu/tmpopqot5t_.py", line 19, in main2 print(sum([is_prime(n) for n in alist])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpmawec9cu/tmpopqot5t_.py", line 19, in <listcomp> print(sum([is_prime(n) for n in alist])) ^^^^^^^^^^^ File "/tmp/tmpmawec9cu/tmpopqot5t_.py", line 13, in is_prime n = ceil(sqrt(n)) ^^^^ NameError: name 'ceil' is not defined
[2, 3, 4, 5, 6, 7]
s706771527
p02257
u581154076
1520087439
Python
Python3
py
Runtime Error
0
0
409
def main2(): alist = [] for _ in range(int(input())): alist.append(int(input())) def is_prime(n): if n == 2: return True if n <= 1 or n % 2 == 0: return False n = ceil(sqrt(n)) for i in range(2, n): if n % i == 0: return False return True print(sum([is_prime(n) for n in alist])) main2()
Traceback (most recent call last): File "/tmp/tmpn4vq8o0d/tmphr45ywc9.py", line 21, in <module> main2() File "/tmp/tmpn4vq8o0d/tmphr45ywc9.py", line 3, in main2 for _ in range(int(input())): ^^^^^^^ EOFError: EOF when reading a line