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
s169277116
p00009
u706217959
1530692856
Python
Python3
py
Runtime Error
0
0
535
import def prime_calc(n): if n < 2: return False else: i = 2 while n > i: if n % i == 0: return False else: i += 1 return True def prime(n): cnt = 0 for i in range(0, n+1): ans = prime_calc(i) if ans is True: cnt = cnt + 1 return cnt def main(): a = [] for line in sys.stdin: a.append(int(line)) for line in a: print(prime(line)) if __name__ == "__main__": main()
File "/tmp/tmpxrekmrvt/tmphp_ft5e9.py", line 1 import ^ SyntaxError: invalid syntax
s139759054
p00009
u706217959
1530693185
Python
Python3
py
Runtime Error
0
0
788
import argparse def prime_calc(n): if n < 2: return False else: i = 2 while n > i: if n % i == 0: return False else: i += 1 return True def prime(n): cnt = 0 for i in range(0, n+1): ans = prime_calc(i) if ans is True: cnt = cnt + 1 return cnt def main(): l = [] parser = argparse.ArgumentParser() parser.add_argument("filename", help="The filename to be processed") args = parser.parse_args() if args.filename: with open(args.filename) as f: for line in f: a = int(line.rstrip()) l.append(a) for line in l: print(prime(line)) if __name__ == "__main__": main()
usage: tmpewnil79h.py [-h] filename tmpewnil79h.py: error: the following arguments are required: filename
s350167879
p00009
u894941280
1344960124
Python
Python
py
Runtime Error
0
1008
272
t =[] for n in range(2,10000): for x in range(2,n): if n % x == 0: break else: t.append(n) while True: try: b=0 a = int(input()) for b in range(10000): if t[b] > a: print len(t[0:b]) break except EOFError: break
File "/tmp/tmppt4tjypv/tmpotbkiv62.py", line 15 print len(t[0:b]) ^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s133269875
p00009
u894941280
1345048556
Python
Python
py
Runtime Error
0
6040
262
t = [] for a in range(2,10000): for n in range(2,a): if a % n == 0: break else: t.append(a) while True: try: z = int(input()) for w in range(1000000): if t[w] > z: break print len(t[0:w]) except EOFError: break
File "/tmp/tmp2go0ucre/tmpv6inxix8.py", line 16 print len(t[0:w]) ^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s678806407
p00009
u894941280
1345122451
Python
Python
py
Runtime Error
0
1004
266
t =[] for n in range(2,10000): for x in range(2,n): if n % x == 0: break else: t.append(n) while True: try: a = int(input()) for b in range(100000): if t[b] >= a: break print len((t[0:b])) except EOFError: break
File "/tmp/tmp5hgzjxw_/tmpf1w56qk1.py", line 17 print len((t[0:b])) ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s575702993
p00009
u891318575
1346517229
Python
Python
py
Runtime Error
0
5020
423
# -*- coding: utf-8 -*- while True: try: n = int(raw_input()) list1 = range(2, n) list2 = [] while True: i = list1.pop(0) list2.append(i) for x in list1: if x % i == 0: list1.remove(x) if i**2 > list1[::-1][0]: break print(len(list2 + list1)) except EOFError: break
Traceback (most recent call last): File "/tmp/tmp89hzga9p/tmpcea7nuzu.py", line 5, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s637527336
p00009
u891318575
1346517347
Python
Python
py
Runtime Error
0
5020
482
# -*- coding: utf-8 -*- while True: try: n = int(raw_input()) if n < 3: print(0) continue list1 = range(2, n) list2 = [] while True: i = list1.pop(0) list2.append(i) for x in list1: if x % i == 0: list1.remove(x) if i**2 > list1[::-1][0]: break print(len(list2 + list1)) except EOFError: break
Traceback (most recent call last): File "/tmp/tmpp63qzxrb/tmpoeqvnc7w.py", line 5, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s991199099
p00009
u647766105
1350991138
Python
Python
py
Runtime Error
0
5012
288
import sys n=10**5 s=[True]*n s[0]=False s[1]=False for x in xrange(2, int(n**0.5)+1): if s[x]: for i in xrange(x+x,n,x): s[i]=False for x in sys.stdin.readlines(): x=int(x) cnt=0 for i in xrange(x): if s[i]: cnt=cnt+1 print cnt
File "/tmp/tmpv5zkpt5_/tmpmov_qetb.py", line 16 print cnt ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s477330240
p00009
u647766105
1350991886
Python
Python
py
Runtime Error
0
5012
288
import sys n=10**5 s=[True]*n s[0]=False s[1]=False for x in xrange(2, int(n**0.5)+1): if s[x]: for i in xrange(x+x,n,x): s[i]=False for x in sys.stdin.readlines(): a=int(x) cnt=0 for i in xrange(a): if s[i]: cnt=cnt+1 print cnt
File "/tmp/tmpk1gy196n/tmph73pi84z.py", line 16 print cnt ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s417080556
p00009
u647766105
1350991922
Python
Python
py
Runtime Error
0
5012
290
import sys n=10**5+1 s=[True]*n s[0]=False s[1]=False for x in xrange(2, int(n**0.5)+1): if s[x]: for i in xrange(x+x,n,x): s[i]=False for x in sys.stdin.readlines(): a=int(x) cnt=0 for i in xrange(a): if s[i]: cnt=cnt+1 print cnt
File "/tmp/tmphsh1asj9/tmposqbg55a.py", line 16 print cnt ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s273490293
p00009
u647766105
1355063082
Python
Python
py
Runtime Error
0
5076
241
import sys n=10**5 p=[1]*n p[0],p[1]=0,0 for i in xrange(2,int(n**0.5)+1): if p[i]==1: for j in xrange(i**2,n,i): p[j]=0 for i in xrange(2,n): p[i]+=p[i-1] for line in sys.stdin.readlines(): print p[int(line)]
File "/tmp/tmpcz1_fp9y/tmp1i_ehiqj.py", line 12 print p[int(line)] ^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s499220680
p00009
u585414111
1365444557
Python
Python
py
Runtime Error
0
0
238
import sys def f(n): li = [x for x in range(2,n+1)] pr = [] while True: pr.append(li[0]) li = [x for x in li if x%li[0]!=0] if li[-1]<pr[-1]**2: return pr+li for n in sys.stdin: print len(f(int(n)))
File "/tmp/tmp82xacsf_/tmpxtlqtyeb.py", line 10 print len(f(int(n))) ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s752816637
p00009
u912237403
1376789235
Python
Python
py
Runtime Error
0
0
849
import math def get_primes(max_number):#return prime list smaller than max_number if max_number == 2: return [2] elif max_number < 3: return [] numbers=range(1, max_number + 2, 2) nroot=math.floor(max_number ** 0.5) n=len(numbers) numbers[0]=0 for i in range(1, n): x = numbers[i] if x > nroot: break if x and i + x < n: for j in range(i+x,n+1,x): numbers[j] = 0 x=[2] + filter(None, numbers[1:]) return x n=[] i=0 while (True): try: n.append([i,input(), 0]) i+=1 except: break n=sorted(n, key=lambda x: x[1]) for i, e in enumerate(get_primes(n[-1][1])): for j in range(len(n)): if e<=n[j][1]: n[j][2]+=1 n=sorted(n, key=lambda x: x[0]) for e in n: print e[2]
File "/tmp/tmpq3w91bew/tmpbdrs_pu6.py", line 41 print e[2] ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s003345443
p00009
u511257811
1381947632
Python
Python
py
Runtime Error
0
0
299
import sys for line in sys.stdin: count = 0 n = int(line) nums = range(2, n+1) while True: if len(nums) == 1: count += 1 break else: count += 1 nums = [ for x in nums[1:] if x % nums[0] != 0 ] print count
File "/tmp/tmph3mvzmyq/tmpnvv7r9l8.py", line 15 nums = [ for x in nums[1:] if x % nums[0] != 0 ] ^^^ SyntaxError: invalid syntax
s988187479
p00009
u511257811
1381947922
Python
Python
py
Runtime Error
0
0
355
import sys for line in sys.stdin: count = 0 n = int(line) nums = range(2, n+1) while True: if len(nums) == 1: count += 1 break else: count += 1 m = nums[0] numsCandidate = [1:] nums = [ for x in numsCandidate if x % m != 0 ] print count
File "/tmp/tmpbip545hc/tmpzg60majq.py", line 16 numsCandidate = [1:] ^ SyntaxError: invalid syntax
s157717712
p00009
u511257811
1381948494
Python
Python
py
Runtime Error
0
0
404
import sys for line in sys.stdin: count = 0 n = int(line) nums = range(2, n+1) while True: if len(nums) == 0: break if len(nums) == 1: count += 1 break else: count += 1 m = nums[0] numsCandidate = nums[1:] nums = [ for x in numsCandidate if x % m != 0 ] print count
File "/tmp/tmptj2tr_5g/tmpzgkl777k.py", line 19 nums = [ for x in numsCandidate if x % m != 0 ] ^^^ SyntaxError: invalid syntax
s216715347
p00009
u511257811
1382032655
Python
Python
py
Runtime Error
0
0
307
import math import sys nums = [1] * 1000000 nums[:2] = [0,0] cnt = 0 while cnt <= math.sqrt(n): flg = nums[cnt] if flg == 1: k = 2 while k*cnt <= n: nums[k*cnt] = 0 k += 1 cnt += 1 for line in sys.stdin: n = int(line) print sum(nums[:n+1])
File "/tmp/tmph9lcrfu8/tmpqvj27ldp.py", line 20 print sum(nums[:n+1]) ^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s328361170
p00009
u674319057
1382322805
Python
Python
py
Runtime Error
0
0
415
#!/usr/bin/env python def get_pn(num, result): if num == 1: return result else: for i in range(2,num-1): if (num % i) == 0: break else: result.append(num) return get_pn(num-1, result) if __name__ == "__main__": while True: try: print len(get_pn(int(raw_input()),[])) except EOFError: break
File "/tmp/tmphk2pv26x/tmpis7j5fyh.py", line 17 print len(get_pn(int(raw_input()),[])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s102008727
p00009
u674319057
1382322858
Python
Python
py
Runtime Error
0
0
423
#!/usr/bin/env python def get_pn(num, result): if num == 1: return result else: for i in range(2,num-1): if (num % i) == 0: break else: result.append(num) return get_pn(num-1, result) if __name__ == "__main__": for i in range(30): try: print len(get_pn(int(raw_input()),[])) except EOFError: break
File "/tmp/tmp4btv7gpa/tmpx2p2j33d.py", line 17 print len(get_pn(int(raw_input()),[])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s606990577
p00009
u674319057
1382322946
Python
Python
py
Runtime Error
0
0
437
#!/usr/bin/env python def get_pn(num, result): if (num == 1 or num == 0): return result else: for i in range(2,num-1): if (num % i) == 0: break else: result.append(num) return get_pn(num-1, result) if __name__ == "__main__": for i in range(30): try: print len(get_pn(int(raw_input()),[])) except EOFError: break
File "/tmp/tmpkjcrja8g/tmp1454pp8_.py", line 17 print len(get_pn(int(raw_input()),[])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s411382551
p00009
u674319057
1382323028
Python
Python
py
Runtime Error
0
0
425
#!/usr/bin/env python def get_pn(num, result): if (num <= 1): return result else: for i in range(2,num-1): if (num % i) == 0: break else: result.append(num) return get_pn(num-1, result) if __name__ == "__main__": for i in range(30): try: print len(get_pn(int(raw_input()),[])) except EOFError: break
File "/tmp/tmprvlds7wn/tmpvij89kq3.py", line 17 print len(get_pn(int(raw_input()),[])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s135046721
p00009
u674319057
1382323117
Python
Python
py
Runtime Error
0
0
423
#!/usr/bin/env python def get_pn(num, result): if (num <= 1): return result else: for i in range(2,num): if (num % i) == 0: break else: result.append(num) return get_pn(num-1, result) if __name__ == "__main__": for i in range(30): try: print len(get_pn(int(raw_input()),[])) except EOFError: break
File "/tmp/tmpokgz2qdp/tmpxw9lzt3q.py", line 17 print len(get_pn(int(raw_input()),[])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s362151391
p00009
u245286435
1384412860
Python
Python
py
Runtime Error
0
0
350
def isPrime(num): flag = True for i in range(2, num): if num % i == 0: flag = False break return flag def countPrime(num): count = 0 for i in range(2, num+1): if isPrime(i): count += 1 return count if __name__ == '__main__': nums = [] for num in sys.stdin: nums.append(int(num)) for num in nums: print countPrime(num)
File "/tmp/tmptbrucudi/tmp0ssdn3ro.py", line 26 print countPrime(num) ^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s802963582
p00009
u093607836
1384690275
Python
Python
py
Runtime Error
0
0
239
import sys rand = random.randint def prime(n): if n == 2: return True if n < 2 or n & 1 == 0: return False return pow(2, n-1, n) == 1 a = [prime(i) for i in range(1000000)] for s in sys.stdin: i = int(s) print(a[:i+1].count(True))
Traceback (most recent call last): File "/tmp/tmpp2y960of/tmpm93yp8lf.py", line 3, in <module> rand = random.randint ^^^^^^ NameError: name 'random' is not defined
s932853278
p00009
u124909914
1392355175
Python
Python
py
Runtime Error
0
0
362
import math ans = [] while True: try: n = int(raw_input()) isPrime = [-1] * (n + 1) isPrime[0], isPrime[1] = False, False i = 2 while i * i < n: for j in range(i, n+i, i): isPrime[j] = False isPrime[i] = True i = isPrime.index(-1) ans.append(isPrime.count(True) + isPrime.count(-1)) except EOFError: break for num in ans: print num
File "/tmp/tmp7pesc9wr/tmp68lefun0.py", line 19 print num ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s243087366
p00009
u633068244
1393352464
Python
Python
py
Runtime Error
0
0
262
while True: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(1:n): j = 2 while k < n: k = i*j filter[k-1] = 0 count = 0 do i in filter: sum += i print sum
File "/tmp/tmpen4sav6t/tmpc2az7g58.py", line 5 for i in range(1:n): ^ SyntaxError: invalid syntax
s242894424
p00009
u633068244
1393352522
Python
Python
py
Runtime Error
0
0
368
while True: try: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(1:n): j = 2 while k < n: k = i*j filter[k-1] = 0 j += 1 count = 0 do i in filter: sum += i print sum except: break
File "/tmp/tmphejip2mi/tmpk2x_maes.py", line 6 for i in range(1:n): ^ SyntaxError: invalid syntax
s650455368
p00009
u633068244
1393353410
Python
Python
py
Runtime Error
0
0
423
while True: while True: try: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(2,n//2): j = 2 k = i*j while k < n: filter[k-1] = 0 j += 1 k = i*j print filter sum = 0 for i in filter: sum += i print sum except: break
File "/tmp/tmpwx6ankyj/tmps92nc9vt.py", line 2 while True: ^ IndentationError: expected an indented block after 'while' statement on line 1
s103520941
p00009
u633068244
1393353804
Python
Python
py
Runtime Error
0
0
473
while True: try: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(2,n//2):        if filter[i] = 1 j = 2 k = i*j while k < n: filter[k-1] = 0 j += 1 k = i*j print filter sum = 0 for i in filter: sum += i print sum except: break
File "/tmp/tmpwm7nek1x/tmpc_rvp2we.py", line 7        if filter[i] = 1 ^ SyntaxError: invalid non-printable character U+3000
s245054720
p00009
u633068244
1393353821
Python
Python
py
Runtime Error
0
0
475
while True: try: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(2,n//2):        if filter[i] == 1: j = 2 k = i*j while k < n: filter[k-1] = 0 j += 1 k = i*j print filter sum = 0 for i in filter: sum += i print sum except: break
File "/tmp/tmpqfw_yovi/tmpliij95x9.py", line 7        if filter[i] == 1: ^ SyntaxError: invalid non-printable character U+3000
s749105086
p00009
u633068244
1393353872
Python
Python
py
Runtime Error
0
0
471
while True: try: n = int(raw_input()) filter = [1 for i in range(n)] filter[0] = 0 for i in range(2,n//2):      if filter[i] == 1: j = 2 k = i*j while k < n: filter[k-1] = 0 j += 1 k = i*j print filter sum = 0 for i in filter: sum += i print sum except: break
File "/tmp/tmpfdt_8zh8/tmp52907_zg.py", line 7      if filter[i] == 1: ^ SyntaxError: invalid non-printable character U+3000
s641878696
p00009
u633068244
1393572657
Python
Python
py
Runtime Error
0
0
316
import math r = 999999 sqrt = int(math.sqrt(r)) prime = [1 for i in range(r)] prime[0] = 0 for i in range(2,r/2): prime[2*i-1] = 0 for i in range(3,sqrt,2): for j in range(2*i,r,i) prime[j] = 0 while True: try: n = int(raw_input()) print sum(prime[:n]) except: break
File "/tmp/tmpycn7sgvp/tmptlstluqi.py", line 10 for j in range(2*i,r,i) ^ SyntaxError: expected ':'
s096343074
p00009
u633068244
1393572945
Python
Python
py
Runtime Error
0
0
305
import math r = 999999 sqrt = int(math.sqrt(r)) prime = "1"*r prime[0] = 0 for i in range(2,r/2): prime[2*i-1] = 0 for i in range(3,sqrt,2): for j in range(2*i,r+1,i): prime[j-1] = 0 while True: try: n = int(raw_input()) print sum(prime[:n]) except: break
File "/tmp/tmpp0duf880/tmpm886t8bh.py", line 16 print sum(prime[:n]) ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s832941235
p00009
u633068244
1393572965
Python
Python
py
Runtime Error
0
0
309
import math r = 999999 sqrt = int(math.sqrt(r)) prime = "1"*r prime[0] = 0 for i in range(2,r/2): prime[2*i-1] = "0" for i in range(3,sqrt,2): for j in range(2*i,r+1,i): prime[j-1] = "0" while True: try: n = int(raw_input()) print sum(prime[:n]) except: break
File "/tmp/tmpf0gaorzl/tmp_kon_t1c.py", line 16 print sum(prime[:n]) ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s494548464
p00009
u633068244
1393572977
Python
Python
py
Runtime Error
0
0
311
import math r = 999999 sqrt = int(math.sqrt(r)) prime = "1"*r prime[0] = "0" for i in range(2,r/2): prime[2*i-1] = "0" for i in range(3,sqrt,2): for j in range(2*i,r+1,i): prime[j-1] = "0" while True: try: n = int(raw_input()) print sum(prime[:n]) except: break
File "/tmp/tmpdp_oza_r/tmpink9l7p_.py", line 16 print sum(prime[:n]) ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s520063673
p00009
u633068244
1393574104
Python
Python
py
Runtime Error
0
0
445
----:---F1 *scratch* All L1 (Fundamental)------------------------------------------------------------------------------------ Loading subst-jis...done import math r = 999999 sqrt = int(math.sqrt(r)) p = [1 for i in range(r)] p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*(i+1)-1,r,i+1): p[j] = 0 while True: try: n = int(raw_input()) print sum(p[:n]) except: break
File "/tmp/tmpvf_bm7n7/tmpjq9cy4yp.py", line 1 ----:---F1 *scratch* All L1 (Fundamental)------------------------------------------------------------------------------------ ^ SyntaxError: invalid syntax
s625227796
p00009
u633068244
1393672642
Python
Python
py
Runtime Error
0
0
283
import math while True: try: n.append(int(raw_input())) except: break r = max(n)+1 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*i+1,r,i+1): p[j] = 0 for i in n: print sum(p[:i])
File "/tmp/tmp6s1r71g8/tmpaxic3g0l.py", line 19 print sum(p[:i]) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s080727649
p00009
u633068244
1393676445
Python
Python
py
Runtime Error
0
0
288
import math n = [] while True: try: n.append(int(raw_input())) except: break r = max(n)+1 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: p[2*i+1::i+1] = range(2*i+1,r,i+1): for i in n: print sum(p[:i])
File "/tmp/tmpexy479hn/tmpmypvh7bs.py", line 15 p[2*i+1::i+1] = range(2*i+1,r,i+1): ^ SyntaxError: invalid syntax
s970051253
p00009
u633068244
1393676473
Python
Python
py
Runtime Error
0
0
296
import math n = [] while True: try: n.append(int(raw_input())) except: break r = max(n)+1 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: p[2*i+1::i+1] = [0 for range(2*i+1,r,i+1)]: for i in n: print sum(p[:i])
File "/tmp/tmph0otxz22/tmpmw1e61bh.py", line 15 p[2*i+1::i+1] = [0 for range(2*i+1,r,i+1)]: ^^^^^^^^^^^^^^^^^^ SyntaxError: cannot assign to function call
s820984870
p00009
u633068244
1393676508
Python
Python
py
Runtime Error
0
0
293
import math n = [] while True: try: n.append(int(raw_input())) except: break r = max(n)+1 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: p[2*i+1::i+1] = [0 for range(2*i+1,r,i+1)] for i in n: print sum(p[:i])
File "/tmp/tmpscml49cy/tmps19ntp7y.py", line 15 p[2*i+1::i+1] = [0 for range(2*i+1,r,i+1)] ^^^^^^^^^^^^^^^^^^ SyntaxError: cannot assign to function call
s383093190
p00009
u633068244
1393676580
Python
Python
py
Runtime Error
0
0
289
import math n = [] while True: try: n.append(int(raw_input())) except: break r = max(n)+1 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: p[2*i+1::i+1] = [0]*range(2*i+1,r,i+1) for i in n: print sum(p[:i])
File "/tmp/tmp3n32l8o9/tmpw277acn5.py", line 18 print sum(p[:i]) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s060395458
p00009
u858885710
1393855129
Python
Python
py
Runtime Error
0
0
239
import sys ifprime = [1]*(1000000) ifprime[0] = ifprime[1] = 0 a = 2 while a <= num: if ifprime[a]: ans += 1 b = a*a while b <= num: ifprime[b] = 0 b += a a += 1 for n in sys.stdin: print sum(ifprime[:int(n)])
File "/tmp/tmp2eiu3ufe/tmp80zv7xnj.py", line 14 print sum(ifprime[:int(n)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s702221446
p00009
u193025715
1395307556
Python
Python
py
Runtime Error
0
0
389
import math val = [] max_prime = 0 while True: num = int(raw_input()) tmp = [i+1 for i in range(1, num)] x = math.sqrt(num) if len(val) != 0: max_prime = val[-1] tmp = tmp[max_prime-1:] print tmp for i in tmp: if i > x: break for j in range(2,num): if i*j > num: break if i*j in tmp: tmp.remove(i*j) val += tmp[len(val):] print val print max_prime print len(tmp)
File "/tmp/tmpetss1705/tmp2kytlcsz.py", line 13 print tmp ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s455093910
p00009
u633068244
1395996155
Python
Python
py
Runtime Error
0
0
177
def isPrime(p): if p == 2: return 1 if p < 2 or p&1 == 0: return 0 return 1 if pow(2,p-1,p) == 1 else 0 n = int(raw_input()) print sum(isPrime(int(i) for i in range(1,n+1))
File "/tmp/tmpuia_n_6e/tmp0u_keppv.py", line 7 print sum(isPrime(int(i) for i in range(1,n+1)) ^ SyntaxError: '(' was never closed
s567473364
p00009
u633068244
1395996236
Python
Python
py
Runtime Error
0
0
194
def isPrime(p): if p == 2: return 1 if p < 2 or p&1 == 0: return 0 return 1 if pow(2,p-1,p) == 1 else 0 while True: try: n = int(raw_input()) print sum(isPrime(i) for i in range(1,n+1))
File "/tmp/tmp2w53isto/tmp6vojxi1d.py", line 9 print sum(isPrime(i) for i in range(1,n+1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s578211264
p00009
u992434746
1401842270
Python
Python3
py
Runtime Error
0
0
616
# coding: utf-8 import sys import math if __name__ == '__main__': input_list = sys.stdin.readlines() for num in input_list: target_number = int(num.replace('\n', '')) serial_number_list = [r for r in range(2, target_number + 1)] multiple_list = [] while math.sqrt(target_number) >= serial_number_list[0]: serial_number = serial_number_list[0] i = 1 multiple_list.append(serial_number) while target_number >= serial_number * i: if serial_number * i in serial_number_list: serial_number_list.pop(serial_number_list.index(serial_number * i)) i += 1 print(multiple_list)
s588522487
p00009
u992434746
1401842458
Python
Python3
py
Runtime Error
0
0
637
# coding: utf-8 import sys import math if __name__ == '__main__': input_list = sys.stdin.readlines() for num in input_list: target_number = int(num.replace('\n', '')) serial_number_list = [r for r in range(2, target_number + 1)] multiple_list = [] while math.sqrt(target_number) >= serial_number_list[0]: serial_number = serial_number_list[0] i = 1 multiple_list.append(serial_number) while target_number >= serial_number * i: if serial_number * i in serial_number_list: serial_number_list.pop(serial_number_list.index(serial_number * i)) i += 1 print(multiple_list + serial_number_list)
s737736396
p00009
u992434746
1401842611
Python
Python3
py
Runtime Error
0
0
642
# coding: utf-8 import sys import math if __name__ == '__main__': input_list = sys.stdin.readlines() for num in input_list: target_number = int(num.replace('\n', '')) serial_number_list = [r for r in range(2, target_number + 1)] multiple_list = [] while math.sqrt(target_number) >= serial_number_list[0]: serial_number = serial_number_list[0] i = 1 multiple_list.append(serial_number) while target_number >= serial_number * i: if serial_number * i in serial_number_list: serial_number_list.pop(serial_number_list.index(serial_number * i)) i += 1 print(len(multiple_list + serial_number_list))
s541923543
p00009
u992434746
1401875803
Python
Python3
py
Runtime Error
0
0
761
import math def sieve_of_erastosthenes(target_list): for num in target_list: input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: print(sum(input_list)) break for s in range(serial ** 2, num, serial): input_list[s] = False if __name__ == '__main__': target_list = [] while True: try: target_list.append(int(input())) except: break sieve_of_erastosthenes(target_list)
s169099360
p00009
u992434746
1401876232
Python
Python3
py
Runtime Error
0
0
697
import math def sieve_of_erastosthenes(num): input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: # print([i for i, b in enumerate(input_list) if b == True]) return sum(input_list) for s in range(serial ** 2, num, serial): input_list[s] = False if __name__ == '__main__': while True: try: n = int(input()) except: break print(sieve_of_erastosthenes(n))
s598956866
p00009
u992434746
1401958316
Python
Python3
py
Runtime Error
0
0
666
import math def sieve_of_erastosthenes(num): input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list for s in range(serial ** 2, num, serial): input_list[s] = False if __name__ == '__main__': while True: try: n = int(input()) except: break input_list = sieve_of_erastosthenes(n) print(sum(input_list))
s326236620
p00009
u992434746
1401958508
Python
Python3
py
Runtime Error
0
0
701
import math def sieve_of_erastosthenes(num): if 2 >= num: return 1 input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list for s in range(serial ** 2, num, serial): input_list[s] = False if __name__ == '__main__': while True: try: n = int(input()) except: break input_list = sieve_of_erastosthenes(n) print(sum(input_list))
s988089281
p00009
u992434746
1401958831
Python
Python3
py
Runtime Error
0
0
721
import math def sieve_of_erastosthenes(num): input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list for s in range(serial ** 2, num, serial): input_list[s] = False if __name__ == '__main__': while True: try: n = int(input()) except: break if 2 >= n: print(1) else: input_list = sieve_of_erastosthenes(n) print(sum(input_list))
s963301506
p00009
u992434746
1401959881
Python
Python3
py
Runtime Error
0
0
456
input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True sqrt = math.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list if input_list[serial] is True: for s in range(serial ** 2, num, serial): input_list[s] = False
File "/tmp/tmpbo12i3tb/tmpnpmld4wa.py", line 1 input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] IndentationError: unexpected indent
s772256971
p00009
u992434746
1402111184
Python
Python3
py
Runtime Error
0
0
690
def sieve_of_erastosthenes(num): input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)] input_list[0] = input_list[1] = False input_list[2] = input_list[3] = input_list[5] = True for serial in range(3, int(num ** 0.5) + 1, 2): if input_list[serial] is True: for s in range(serial ** 2, num, serial): input_list[s] = False # print([i for i, b in enumerate(input_list) if b == True]) return sum(input_list) if __name__ == '__main__': while True: try: n = int(input()) except: break print(sieve_of_erastosthenes(n))
s648969203
p00010
u995990363
1530789227
Python
Python3
py
Runtime Error
0
0
588
import math def run(): n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3 = list(map(float, input().split())) u1 = (x1-x3)*(x2-x1)*(x3-x2) u2 = (x2-x1)*(y3-y2)*(y3+y2) u3 = (x3-x2)*(y2-y1)*(y2+y1) v = x1*x2 + x2*y3 + x3*y1 - x1*y3 - x2*y1 + x3*y2 Py = (-u1 + u2 - u3) / v / 2 Px = (x2**2 - x1**2 + y2**2 - y1**2 - (y2 - y1)*Py) / (x2-x1) / 2 r = math.sqrt((Px-x1)**2 + (Py-y1)**2) print('{0:.3f} {1:.3f} {2:.3f}'.format(round(Px,3), round(Py,3), round(r,3))) if __name__ == '__main__': run()
Traceback (most recent call last): File "/tmp/tmpsflqjuef/tmpefj7qh1z.py", line 17, in <module> run() File "/tmp/tmpsflqjuef/tmpefj7qh1z.py", line 4, in run n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s701534005
p00010
u319725914
1534986400
Python
Python3
py
Runtime Error
0
0
1070
#include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <string> #include <cctype> #include <sstream> #include <cmath> #include <climits> #include <set> #include <iostream> #include <map> #include <functional> #include <cstdlib> #include <numeric> #include <queue> #include <complex> #include <sstream> #include <stack> using namespace std; #define reep(i, f, n) for (int i = f; i < n; ++i) #define rep(i, n) reep(i, 0, n) int main(){ float x1,x2,x3,y1,y2,y3,gx,gy,G,Xc,Yc,r; int n; scanf("%d", &n); for (int i=0;i<n;i++) { scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3); gx = (x1+x2+x3)/3; gy = (y1+y2+y3)/3; G =( y2*x1-y1*x2 +y3*x2-y2*x3 +y1*x3-y3*x1 ); Xc = ((x1*x1+y1*y1)*(y2-y3)+(x2*x2+y2*y2)*(y3-y1)+(x3*x3+y3*y3)*(y1-y2))/(2*G); Yc =-((x1*x1+y1*y1)*(x2-x3)+(x2*x2+y2*y2)*(x3-x1)+(x3*x3+y3*y3)*(x1-x2))/(2*G); r = sqrt( (x1 - Xc) * (x1 - Xc) + (y1 - Yc) * (y1 - Yc) ); printf("%.3f %.3f %.3f\n", Xc, Yc, r); } return EXIT_SUCCESS; }
File "/tmp/tmp_1jey5d_/tmpaw9p6wub.py", line 21 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s521544017
p00010
u244742296
1409819739
Python
Python3
py
Runtime Error
0
0
1599
import cmath class Point(object): def __init__(self, x, y): self.point = complex(x, y) def __str__(self): return "x = {0}, y = {1}".format(self.point.real, self.point.imag) class Triangle(Point): def __init__(self, a, b, c): self.a = a self.b = b self.c = c # 3辺の長さ self.edgeA = abs(b.point-c.point) self.edgeB = abs(c.point-a.point) self.edgeC = abs(a.point-b.point) # 3角の大きさ self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC) self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA) self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB) # 角度を求める def angle(A, B, C): return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ) # 外接円の半径 def circumscribedCircleRadius(self): return abs((self.edgeA/cmath.sin(self.angleA))/2) # 外心 def circumscribedCircleCenter(self): A = cmath.sin(2*self.angleA) B = cmath.sin(2*self.angleB) C = cmath.sin(2*self.angleC) X = (self.a.point.real*A + self.b.point.real*B + self.c.point.real*C) / (A+B+C) Y = (self.a.point.imag*A + self.b.point.imag*B + self.c.point.imag*C) / (A+B+C) return complex(X, Y) line = list(map(float, input().split())) p1 = Point(line[0], line[1]) p2 = Point(line[2], line[3]) p3 = Point(line[4], line[5]) T = Triangle(p1, p2, p3) center = T.circumscribedCircleCenter() print("{0:.4f} {1:.4f} {2:.4f}".format(center.real, center.imag, T.circumscribedCircleRadius()))
Traceback (most recent call last): File "/tmp/tmpoe9_bk6r/tmpsvdx0mca.py", line 41, in <module> line = list(map(float, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s065758709
p00010
u244742296
1409819859
Python
Python3
py
Runtime Error
0
0
1624
# -*- coding: utf-8 -*- import cmath class Point(object): def __init__(self, x, y): self.point = complex(x, y) def __str__(self): return "x = {0}, y = {1}".format(self.point.real, self.point.imag) class Triangle(Point): def __init__(self, a, b, c): self.a = a self.b = b self.c = c # 3辺の長さ self.edgeA = abs(b.point-c.point) self.edgeB = abs(c.point-a.point) self.edgeC = abs(a.point-b.point) # 3角の大きさ self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC) self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA) self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB) # 角度を求める def angle(A, B, C): return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ) # 外接円の半径 def circumscribedCircleRadius(self): return abs((self.edgeA/cmath.sin(self.angleA))/2) # 外心 def circumscribedCircleCenter(self): A = cmath.sin(2*self.angleA) B = cmath.sin(2*self.angleB) C = cmath.sin(2*self.angleC) X = (self.a.point.real*A + self.b.point.real*B + self.c.point.real*C) / (A+B+C) Y = (self.a.point.imag*A + self.b.point.imag*B + self.c.point.imag*C) / (A+B+C) return complex(X, Y) line = list(map(float, input().split())) p1 = Point(line[0], line[1]) p2 = Point(line[2], line[3]) p3 = Point(line[4], line[5]) T = Triangle(p1, p2, p3) center = T.circumscribedCircleCenter() print("{0:.4f} {1:.4f} {2:.4f}".format(center.real, center.imag, T.circumscribedCircleRadius()))
Traceback (most recent call last): File "/tmp/tmpmmhdc9a4/tmpgta_pvln.py", line 43, in <module> line = list(map(float, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s557884869
p00010
u244742296
1409819942
Python
Python3
py
Runtime Error
0
0
1511
# -*- coding: utf-8 -*- import cmath class Point(object): def __init__(self, x, y): self.point = complex(x, y) def __str__(self): return "x = {0}, y = {1}".format(self.point.real, self.point.imag) class Triangle(Point): def __init__(self, a, b, c): self.a = a self.b = b self.c = c self.edgeA = abs(b.point-c.point) self.edgeB = abs(c.point-a.point) self.edgeC = abs(a.point-b.point) self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC) self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA) self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB) def angle(A, B, C): return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ) def circumscribedCircleRadius(self): return abs((self.edgeA/cmath.sin(self.angleA))/2) def circumscribedCircleCenter(self): A = cmath.sin(2*self.angleA) B = cmath.sin(2*self.angleB) C = cmath.sin(2*self.angleC) X = (self.a.point.real*A + self.b.point.real*B + self.c.point.real*C) / (A+B+C) Y = (self.a.point.imag*A + self.b.point.imag*B + self.c.point.imag*C) / (A+B+C) return complex(X, Y) line = list(map(float, input().split())) p1 = Point(line[0], line[1]) p2 = Point(line[2], line[3]) p3 = Point(line[4], line[5]) T = Triangle(p1, p2, p3) center = T.circumscribedCircleCenter() print("{0:.4f} {1:.4f} {2:.4f}".format(center.real, center.imag, T.circumscribedCircleRadius()))
Traceback (most recent call last): File "/tmp/tmpecki0yjj/tmpzmv0qj2h.py", line 43, in <module> line = list(map(float, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s033707512
p00010
u244742296
1409824731
Python
Python3
py
Runtime Error
0
0
1624
# -*- coding: utf-8 -*- import cmath class Point(object): def __init__(self, x, y): self.point = complex(x, y) def __str__(self): return "x = {0}, y = {1}".format(self.point.real, self.point.imag) class Triangle(Point): def __init__(self, a, b, c): self.a = a self.b = b self.c = c # 3辺の長さ self.edgeA = abs(b.point-c.point) self.edgeB = abs(c.point-a.point) self.edgeC = abs(a.point-b.point) # 3角の大きさ self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC) self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA) self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB) # 角度を求める def angle(A, B, C): return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ) # 外接円の半径 def circumscribedCircleRadius(self): return abs((self.edgeA/cmath.sin(self.angleA))/2) # 外心 def circumscribedCircleCenter(self): A = cmath.sin(2*self.angleA) B = cmath.sin(2*self.angleB) C = cmath.sin(2*self.angleC) X = (self.a.point.real*A + self.b.point.real*B + self.c.point.real*C) / (A+B+C) Y = (self.a.point.imag*A + self.b.point.imag*B + self.c.point.imag*C) / (A+B+C) return complex(X, Y) line = list(map(float, input().split())) p1 = Point(line[0], line[1]) p2 = Point(line[2], line[3]) p3 = Point(line[4], line[5]) T = Triangle(p1, p2, p3) center = T.circumscribedCircleCenter() print("{0:.4f} {1:.4f} {2:.4f}".format(center.real, center.imag, T.circumscribedCircleRadius()))
Traceback (most recent call last): File "/tmp/tmpp9c47_kh/tmp4tcay2lz.py", line 43, in <module> line = list(map(float, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s988774061
p00010
u772921135
1417035034
Python
Python
py
Runtime Error
0
0
412
# coding: UTF-8 # main.py import math t = map(int,raw_input().split()) for i in xrange(0,t[0]): x1,x2,x3,y1,y2,y3 = map(float,raw_input().split()) a = x1-x2 b = y1-y2 c = -(x1*x1 + y1*y1 - x2*x2 - y2*y2) d = x2-x3 e = y2-y3 f = -(x2*x2 + y2*y2 - x3*x3 - y3*y3) l = (c*e - b*f)/(a*e - b*d) m = (d*c - a*f)/(d*b - e*a) n = -(x1*x1 + y1*y1 + l*x1 + m*y1) print l*-0.5,m*-0.5,math.sqrt(l*l+m*m-n*4.0)/2.0
File "/tmp/tmpvhqtzzoz/tmphtxdd4h_.py", line 17 print l*-0.5,m*-0.5,math.sqrt(l*l+m*m-n*4.0)/2.0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s911095464
p00010
u567380442
1424177241
Python
Python3
py
Runtime Error
0
0
729
import sys def take2(iterable): while True: yield next(iterable), next(iterable) #外積 def cross(v1, v2): return v1.real * v2.imag - v1.imag * v2.real # 線分13と線分24の交点を求める def get_intersection(p1,p2,p3,p4): a1 = p4 - p2 b1 = p2 - p3 b2 = p1 - p2 s1 = cross(a1, b2) / 2 s2 = cross(a1, b1) / 2 return p1 + (p3 - p1) * s1 / (s1 + s2) n = int(f.readline()) for i in range(n): p1, p2, p3 = [x + y * 1j for x, y in take2(map(float, f.readline().split()))] p12 = (p1 + p2) / 2 p13 = (p1 + p3) / 2 pxy = get_intersection(p12,p13,p12 + (p2 - p1) * 1j,p13 + (p1 - p3) * 1j) r = abs(pxy - p1) print('{:.3f} {:.3f} {:.3f}'.format(pxy.real,pxy.imag,r))
Traceback (most recent call last): File "/tmp/tmp6hzi4r6j/tmpa6u2u602.py", line 18, in <module> n = int(f.readline()) ^ NameError: name 'f' is not defined
s314705763
p00010
u540744789
1425718881
Python
Python
py
Runtime Error
0
0
706
import math for i in range(input()): x1,y1,x2,y2,x3,y3=map(float,raw_input().split(" ")) if y2==y1 or y3==y1: if y2==y1: a2=-(x2-x1)/(y3-y1) b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f,=1,0,(x1+x2)/2,1,-a2,b2 else: a1=-(x2-x1)/(y2-y1) b1=((y2+y1)-a2*(x1+x2))/2 a,b,c,d,e,f,=1,-a1,b1,1,0,(x1+x3)/2 else: a1=-(x2-x1)/(y2-y1) a2=-(x3-x1)/(y3-y1) b1=((y2+y1)-a1*(x1+x2))/2 b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f,=1,-a1,b1,1,-a2,b2 py=(a*f-c*d)/(a*e-b*d) px=(c*e-f*b)/(a*e-b*d) r=math.sqrt((px-x1)**2 + (py-y1)**2) print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r)
File "/tmp/tmpvo7wynko/tmp7mjy0kfx.py", line 22 print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s508923881
p00010
u540744789
1425719262
Python
Python
py
Runtime Error
0
0
706
import math for i in range(input()): x1,y1,x2,y2,x3,y3=map(float,raw_input().split(" ")) if y2==y1 or y3==y1: if y2==y1: a2=-(x3-x1)/(y3-y1) b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f,=0,1,(x1+x2)/2,-a2,1,b2 else: a1=-(x2-x1)/(y2-y1) b1=((y2+y1)-a2*(x1+x2))/2 a,b,c,d,e,f,=-a1,1,b1,0,1,(x1+x3)/2 else: a1=-(x2-x1)/(y2-y1) a2=-(x3-x1)/(y3-y1) b1=((y2+y1)-a1*(x1+x2))/2 b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f,=-a1,1,b1,-a2,1,b2 py=(a*f-c*d)/(a*e-b*d) px=(c*e-f*b)/(a*e-b*d) r=math.sqrt((px-x1)**2 + (py-y1)**2) print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r)
File "/tmp/tmpxa_tmxrk/tmp20olyx5a.py", line 22 print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s585418388
p00010
u540744789
1425719649
Python
Python
py
Runtime Error
0
0
703
import math for i in range(input()): x1,y1,x2,y2,x3,y3=map(float,raw_input().split(" ")) if y2==y1 or y3==y1: if y2==y1: a2=-(x3-x1)/(y3-y1) b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f=0,1,(x1+x2)/2,-a2,1,b2 else: a1=-(x2-x1)/(y2-y1) b1=((y2+y1)-a2*(x1+x2))/2 a,b,c,d,e,f=-a1,1,b1,0,1,(x1+x3)/2 else: a1=-(x2-x1)/(y2-y1) a2=-(x3-x1)/(y3-y1) b1=((y2+y1)-a1*(x1+x2))/2 b2=((y3+y1)-a2*(x1+x3))/2 a,b,c,d,e,f=-a1,1,b1,-a2,1,b2 py=(a*f-c*d)/(a*e-b*d) px=(c*e-f*b)/(a*e-b*d) r=math.sqrt((px-x1)**2 + (py-y1)**2) print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r)
File "/tmp/tmpwkte0b5x/tmpsnks32lj.py", line 22 print "{0:.3f} {1:.3f} {2:.3f}".format(px,py,r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s784666888
p00010
u379956761
1434726644
Python
Python3
py
Runtime Error
0
0
568
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math n = int(input()) for data in sys.stdin: if n <= 0: break n-- x1, y1, x2, y2, x3, y3 = map(float, data.split()) a1 = x2 - x1 b1 = y2 - y1 a2 = x3 - x1 b2 = y3 - y1 px = (b2 * (a1 * a1 + b1 * b1) - b1 * (a2 * a2 + b2 * b2)) / (2 * (a1 * b2 - a2 * b1)) py = (a1 * (a2 * a2 + b2 * b2) - a2 * (a1 * a1 + b1 * b1)) / (2 * (a1 * b2 - a2 * b1)) r = math.sqrt(px * px + py * py) px += x1 py += y1 print("{0:.3f} {1:.3f} {2:.3f}".format(px, py, r))
File "/tmp/tmp8z5mn1h1/tmpls7fbaai.py", line 12 n-- ^ SyntaxError: invalid syntax
s322827297
p00010
u722431421
1439541980
Python
Python
py
Runtime Error
0
0
494
# coding: utf-8 #Problem Name: Circumscrived Circle of a Triangle #ID: tabris #Mail: t123037@kaiyodai.ac.jp n = int(raw_input()) data = [0 for _ in range(n)] for i in range(n): data[i] = map(float,raw_input().split(' ')) for (x1,y1,x2,y2,x3,y3) in data: det = 4*x2*y3 - 4*y2*x3 px = ((x2**2 + y2**2)*2*y3 - (x3**2 + y3**2)*2*y2)/det py = (2*x2*(x3**2 + y3**2) - 2*x3*(x2**2 + y2**2))/det r = ((px-x1)**2 + (py-y1)**2)**.5 print '{0:.3f} {1:.3f} {2:.3f}'.format(px,py,r)
File "/tmp/tmpq3ckpp2r/tmpzuqvblja.py", line 15 print '{0:.3f} {1:.3f} {2:.3f}'.format(px,py,r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s955385463
p00010
u560214129
1450423270
Python
Python3
py
Runtime Error
0
0
476
import math n = int(input()) i = 0 while i < n: x1, y1, x2, y2, x3, y3 = map(float,input().split()) a = x2 - x1 b = y2 - y1 c = x3 - x1 d = y3 - y1 e = a * (x1 + x2) + b * (y1 + y3) f = c * (x1 + x2) + d * (y1 + y3) g = 2.0 * (a * (y3 - y2) - b * (x3 - x2)) if g == 0: exit() px = (d * e - b * f) / g py = (a * f - c * e) / g radius = ( (py - y1)*(py - y1) + (px - x1)*(px - x1) ) print("%.3f %.3f %.3f"%(px,py,math.sqrt(radius)))
Traceback (most recent call last): File "/tmp/tmp2ql1evau/tmpz3f8_a1g.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s748816088
p00010
u650459696
1456727214
Python
Python3
py
Runtime Error
0
0
578
def circum(x1,x2,x3,y1,y2,y3): a1 = 2 * (x2 - x1) b1 = 2 * (y2 - y1) c1 = x1 ** 2 - x2 ** 2 + y1 **2 - y2 ** 2 a2 = 2 * (x3 - x1) b2 = 2 * (y3 - y1) c2 = x1 ** 2 - x3 ** 2 + y1 **2 - y3 ** 2 X = (b1 * c2 - b2 * c1)/(a1 * b2 - a2 * b1) Y = (c1 * a2 - c2 * a1)/(a1 * b2 - a2 * b1) R = ((x1 - X) ** 2 + (y1 - Y) ** 2) ** 0.5 return map(lambda n: round(n,3), [X,Y,R]) N = int(input()) ans = [] for i in range(N): ans.append(circum(*list(map(float,input().split())))) for i in range(N): print('{0:.3f} {1:.3f} {2:.3f}'.format(*ans[i]))
Traceback (most recent call last): File "/tmp/tmp28pniag5/tmpwjifveua.py", line 12, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s564589367
p00010
u915343634
1459349526
Python
Python3
py
Runtime Error
0
0
485
import sys import math if sys.version_info[0] >= 3: raw_input = input N = int(raw_input()) for i in range(N): x1, y1, x2, y2, x3, y3 = [float(e) for e in raw_input().split()] a1 = 2*x2 - 2*x1 b1 = 2*y2 - 2*y1 c1 = x1**2 - x2**2 + y1**2 - y2**2 a2 = 2 * x3 - 2 * y1 b2 = 2 * y3 - 2 * y1 c2 = x1**2 - x3**2 + y1**2 - y3**2 x = (b1*c2-b2*c1)/(a1*b2-a2*b1) y = (c1*a2-c2*a1)/(a1*b2-a2*b1) print("%.3f %.3f %.3f" %(x, y, math.hypot(x1-x, y1-y)))
Traceback (most recent call last): File "/tmp/tmp6259ttxv/tmpky45yvi7.py", line 6, in <module> N = int(raw_input()) ^^^^^^^^^^^ EOFError: EOF when reading a line
s745746882
p00010
u966364923
1460036436
Python
Python3
py
Runtime Error
0
0
1629
def perpendicular_bisector(p, q): x = (q[0] - p[0]) y = (q[1] - p[1]) return (2 * x, 2 * y, -x**2 - y**2) def gauss_jordan_elimination(Array): # N???M??????Array N = len(Array) if N == 0: return (True, Array) else: M = len(Array[0]) A = [] for i in range(len(Array)): A.append(Array[i][:]) pivot = 0 L = min(N, M) while pivot < L: pivot_v = A[pivot][pivot] pivot_row = pivot for i in range(pivot + 1, L): v = max(A[i][pivot], -A[i][pivot]) if pivot_v < v: pivot_row = i pivot_v = v if pivot_row > pivot: for i in range(M): A[pivot][i], A[pivot_row][i] = A[pivot_row][i], A[pivot][i] if pivot_v == 0: return ('False', A) inv_pivot = 1 / A[pivot][pivot] A[pivot][pivot] = 1 for i in range(pivot + 1, M): A[pivot][i] *= inv_pivot for i in range(N): if i == pivot: continue t = -1 * A[i][pivot] A[i][pivot] = 0 for j in range(pivot + 1, M): A[i][j] += t * A[pivot][j] pivot += 1 return ('True', A) n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3 = map(int, input().split()) a = list(perpendicular_bisector((x1, y1), (x2, y2))) b = list(perpendicular_bisector((x1, y1), (x3, y3))) c = [a, b] state, c = gauss_jordan_elimination(c) x = c[0][2] y = c[1][2] r = ((x - x1)**2 + (y - y1)**2)**0.5 print(round(x, 3), round(y, 3), round(r, 3))
Traceback (most recent call last): File "/tmp/tmpjutjf36n/tmp1yxjde_c.py", line 48, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s465297109
p00010
u146816547
1469285189
Python
Python
py
Runtime Error
0
0
488
import math n = int(raw_input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(int, raw_input().split()) px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2))) py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1 - x2)*(x3*x3 + y3*y3))/(2*(y1*(x2 - x3) + y2*(x3 - x1) + y3*(x1 - x2))) r = math.sqrt(pow((x1 - px), 2) + pow((y1 - py), 2)) print "%.4f %.4f %.4f" % (px, py, r)
File "/tmp/tmpkyffprgy/tmpfmy7s2cr.py", line 14 print "%.4f %.4f %.4f" % (px, py, r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s976251197
p00010
u146816547
1469285290
Python
Python
py
Runtime Error
0
0
488
import math n = int(raw_input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(int, raw_input().split()) px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2))) py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1 - x2)*(x3*x3 + y3*y3))/(2*(y1*(x2 - x3) + y2*(x3 - x1) + y3*(x1 - x2))) r = math.sqrt(pow((x1 - px), 2) + pow((y1 - py), 2)) print "%.3f %.3f %.3f" % (px, py, r)
File "/tmp/tmpcrd_d016/tmp28b2ear3.py", line 14 print "%.3f %.3f %.3f" % (px, py, r) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s518084268
p00010
u813534019
1477494834
Python
Python
py
Runtime Error
0
0
494
import math x1=0 y1=1 x2=2 y2=3 x3=4 y3=5 n = input() for _ in xrange(n): p = map(float, raw_input().split()) A = p[x1]**2 - p[x2]**2 + p[y1]**2 - p[y2]**2 B = 2*p[x1] - 2*p[x2] C = 2*p[y1] - 2*p[y2] D = p[x1]**2 - p[x3]**2 + p[y1]**2 - p[y3]**2 E = 2*p[x1] - 2*p[x3] F = 2*p[y1] - 2*p[y3] b = (A*E-D*B)/(C*E-B*F) a = (A*E-C*E*b)/(B*E) r = math.sqrt( (p[x1]-a)**2 + (p[y1]-b)**2 ) print "%.3f %.3f %.3f" % (round(a, 3), round(b, 3), round(r, 3))
File "/tmp/tmpycw140af/tmp7al_t87k.py", line 20 print "%.3f %.3f %.3f" % (round(a, 3), round(b, 3), round(r, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s841143812
p00010
u776559258
1477560284
Python
Python3
py
Runtime Error
0
0
211
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=[int(i) for i in input().split()] px=(x1+x2+x3)/3 py=(y1+y2+y3)/3 r=math.sqrt((x1-px)**2+(y1-py)**2) print(round(px,3),round(py,3),round(r,3))
Traceback (most recent call last): File "/tmp/tmpjnj83vbp/tmp5nzdrlhw.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s412278712
p00010
u776559258
1477560503
Python
Python3
py
Runtime Error
0
0
220
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=[int(i) for i in input().split()] p_x=(x1+x2+x3)/3 p_y=(y1+y2+y3)/3 r=math.sqrt((x1-p_x)**2+(y1-p_y)**2) print(round(p_x,3),round(p_y,3),round(r,3))
File "/tmp/tmpq6ihu240/tmpjsdbwn0h.py", line 8 print(round(p_x,3),round(p_y,3),round(r,3)) ^ SyntaxError: invalid non-printable character U+007F
s899926985
p00010
u776559258
1477560544
Python
Python3
py
Runtime Error
0
0
220
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=[int(j) for j in input().split()] p_x=(x1+x2+x3)/3 p_y=(y1+y2+y3)/3 r=math.sqrt((x1-p_x)**2+(y1-p_y)**2) print(round(p_x,3),round(p_y,3),round(r,3))
File "/tmp/tmpef_b5kbn/tmp9__xa7az.py", line 8 print(round(p_x,3),round(p_y,3),round(r,3)) ^ SyntaxError: invalid non-printable character U+007F
s115789405
p00010
u776559258
1477560612
Python
Python3
py
Runtime Error
0
0
222
import math n=int(input()) for i in range(n): (x1,y1,x2,y2,x3,y3)=[int(j) for j in input().split()] p_x=(x1+x2+x3)/3 p_y=(y1+y2+y3)/3 r=math.sqrt((x1-p_x)**2+(y1-p_y)**2) print(round(p_x,3),round(p_y,3),round(r,3))
File "/tmp/tmpbagftg__/tmp6yi5xg9d.py", line 8 print(round(p_x,3),round(p_y,3),round(r,3)) ^ SyntaxError: invalid non-printable character U+007F
s226022657
p00010
u776559258
1477560717
Python
Python3
py
Runtime Error
0
0
222
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=[float(i) for i in input().split()] p_x=(x1+x2+x3)/3 p_y=(y1+y2+y3)/3 r=math.sqrt((x1-p_x)**2+(y1-p_y)**2) print(round(p_x,3),round(p_y,3),round(r,3))
File "/tmp/tmp7zv2asv2/tmpwj984swk.py", line 8 print(round(p_x,3),round(p_y,3),round(r,3)) ^ SyntaxError: invalid non-printable character U+007F
s416847749
p00010
u776559258
1477560755
Python
Python3
py
Runtime Error
0
0
226
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=[float(i) for i in input().split()] p_x=(x1+x2+x3)/3.0 p_y=(y1+y2+y3)/3.0 r=math.sqrt((x1-p_x)**2+(y1-p_y)**2) print(round(p_x,3),round(p_y,3),round(r,3))
File "/tmp/tmp4z0l9o7o/tmp5zk3o4et.py", line 8 print(round(p_x,3),round(p_y,3),round(r,3)) ^ SyntaxError: invalid non-printable character U+007F
s325666559
p00010
u149199817
1478146799
Python
Python3
py
Runtime Error
0
0
1425
# -*- coding: utf-8 -*- import sys def length(a, b): return ((a[0] - b[0])**2 + (a[1] - b[1])**2)**0.5 def solve_sim_equ(a, b, c, d, e, f): ''' From Problem 0004. This function solves following equation. ax + by = c dx + ey = f ''' if a==0 and d==0: if b==0 and e==0: return 0., 0. if b != 0: return 0., c/b+0. else: return 0., f/e+0. elif b==0 and e==0: if a != 0: return 0., d/a+0. else: return 0., a/d+0. if b == 0: a, d = d, a b, e = e, b c, f = f, c g = e / b x = (g*c - f) / (g*a - d) y = (c - a*x) / b return x+0., y+0. def circumscribed_circle(x, y, z): def get_equ_coef(p, q): h_x = (p[0] + q[0]) / 2 h_y = (p[1] + q[1]) / 2 a = q[1] - p[1] b = p[0] - q[0] c = b * h_x - a * h_y return b, -a, c coef = get_equ_coef(x, y) + get_equ_coef(y, z) center = solve_sim_equ(*coef) r = length(center, x) return center, r def main(): N = int(input()) for i in range(N): vs = [float(v) for v in input().split()] a = (vs[0], vs[1]) b = (vs[2], vs[3]) c = (vs[4], vs[5]) center, r = circumscribed_circle2(a, b, c) print('{0:.3f} {1:.3f} {2:.3f}'.format(center[0], center[1], r)) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmpmnfu2n2f/tmppdd9tfax.py", line 64, in <module> main() File "/tmp/tmpmnfu2n2f/tmppdd9tfax.py", line 53, in main N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s305419532
p00010
u149199817
1478146830
Python
Python3
py
Runtime Error
0
0
1425
# -*- coding: utf-8 -*- import sys def length(a, b): return ((a[0] - b[0])**2 + (a[1] - b[1])**2)**0.5 def solve_sim_equ(a, b, c, d, e, f): ''' From Problem 0004. This function solves following equation. ax + by = c dx + ey = f ''' if a==0 and d==0: if b==0 and e==0: return 0., 0. if b != 0: return 0., c/b+0. else: return 0., f/e+0. elif b==0 and e==0: if a != 0: return 0., d/a+0. else: return 0., a/d+0. if b == 0: a, d = d, a b, e = e, b c, f = f, c g = e / b x = (g*c - f) / (g*a - d) y = (c - a*x) / b return x+0., y+0. def circumscribed_circle(x, y, z): def get_equ_coef(p, q): h_x = (p[0] + q[0]) / 2 h_y = (p[1] + q[1]) / 2 a = q[1] - p[1] b = p[0] - q[0] c = b * h_x - a * h_y return b, -a, c coef = get_equ_coef(x, y) + get_equ_coef(y, z) center = solve_sim_equ(*coef) r = length(center, x) return center, r def main(): N = int(input()) for i in range(N): vs = [float(v) for v in input().split()] a = (vs[0], vs[1]) b = (vs[2], vs[3]) c = (vs[4], vs[5]) center, r = circumscribed_circle2(a, b, c) print('{0:.3f} {1:.3f} {2:.3f}'.format(center[0], center[1], r)) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp0a03jhbn/tmpl1z3ku4q.py", line 64, in <module> main() File "/tmp/tmp0a03jhbn/tmpl1z3ku4q.py", line 53, in main N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s110186981
p00010
u252368621
1479000112
Python
Python3
py
Runtime Error
0
0
591
import math deta=[float(i) for i in input().split()] h1=math.sqrt((deta[2]-deta[0])**2+(deta[3]-deta[1])**2) h2=math.sqrt((deta[4]-deta[2])**2+(deta[5]-deta[3])**2) h3=math.sqrt((deta[0]-deta[4])**2+(deta[1]-deta[5])**2) sub=(h1+h2+h3)/2 s=math.sqrt(sub*(sub-h1)*(sub-h2)*(sub-h3)) sum=((h1*h2*h3)/s)/4 a=2*deta[2]-2*deta[0] b=2*deta[3]-2*deta[1] c=-(deta[0]**2+deta[1]**2-(deta[2]**2)-(deta[3]**2)) d=2*deta[4]-2*deta[2] e=2*deta[5]-2*deta[3] f=-(deta[2]**2+deta[3]**2-(deta[4]**2)-(deta[5]**2)) x=(e*c-b*f)/(a*e-b*d) y=(a*f-c*d)/(a*e-b*d) print("{0:.3f} {1:.3f} {2:.3f}".format(x,y,sum))
Traceback (most recent call last): File "/tmp/tmpep_z41cj/tmpav2_puzf.py", line 2, in <module> deta=[float(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s024682548
p00010
u011621222
1490023512
Python
Python
py
Runtime Error
0
0
413
from math import sqrt n=input() for i in range(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) B1=2*(y2-y1) C1=x2**2+y2**2-x1**2-y1**2 x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1)) y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1)) a=sqrt((x2-x1)**2+(y2-y1)**2) b=sqrt((x3-x1)**2+(y3-y1)**2) c=sqrt((x3-x2)**2+(y3-y2)**2) p=(a+b+c)/2 S=sqrt(p*(p-a)*(p-b)*(p-c)) R=a*b*c/4/S print"%.3f %.3f %.3f"%(x,y,R)
File "/tmp/tmpp7f044i2/tmpe5lzplfk.py", line 16 print"%.3f %.3f %.3f"%(x,y,R) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s742648167
p00010
u011621222
1490023638
Python
Python
py
Runtime Error
0
0
234
from math import sqrt n=input() for i in range(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) B1=2*(y2-y1) C1=x2**2+y2**2-x1**2-y1**2 x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1)) y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))
Traceback (most recent call last): File "/tmp/tmp8quxr3ch/tmpkw7zsfnd.py", line 2, in <module> n=input() ^^^^^^^ EOFError: EOF when reading a line
s424874268
p00010
u011621222
1490023736
Python
Python
py
Runtime Error
0
0
218
from math import sqrt n=input() for i in range(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) B1=2*(y2-y1) C1=x2**2+y2**2-x1**2-y1**2 A2=2*(x3-x2) B2=2*(y3-y2) C2=x3**2+y3**2-x2**2-y2**2
File "/tmp/tmper_esikh/tmp0mfuob_0.py", line 9 B2=2*(y3-y2) ^ IndentationError: unindent does not match any outer indentation level
s372109148
p00010
u797673668
1490620798
Python
Python3
py
Runtime Error
0
0
623
import fractions def calc(x1, y1, x2, y2): return 2 * (x2 - x1), 2 * (y2 - y1), x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2 n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) cx1, cy1, z1 = calc(x1, y1, x2, y2) cx2, cy2, z2 = calc(x1, y1, x3, y3) print(cx1, cy1, z1, cx2, cy2, z2) gcd = fractions.gcd(cx1, cx2) r1, r2 = cx2 // gcd, cx1 // gcd dcy = r1 * cy1 - r2 * cy2 dz = r1 * z1 - r2 * z2 y = dz / dcy x = (z1 - cy1 * y) / cx1 r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5 print(*map(lambda x: '{:.3f}'.format(round(x, 3)), (x, y, r)))
Traceback (most recent call last): File "/tmp/tmpm3_asw1z/tmpniqaif59.py", line 8, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s765675391
p00010
u797673668
1490620884
Python
Python3
py
Runtime Error
0
0
585
import fractions def calc(x1, y1, x2, y2): return 2 * (x2 - x1), 2 * (y2 - y1), x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2 n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) cx1, cy1, z1 = calc(x1, y1, x2, y2) cx2, cy2, z2 = calc(x1, y1, x3, y3) gcd = fractions.gcd(cx1, cx2) r1, r2 = cx2 // gcd, cx1 // gcd dcy = r1 * cy1 - r2 * cy2 dz = r1 * z1 - r2 * z2 y = dz / dcy x = (z1 - cy1 * y) / cx1 r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5 print(*map(lambda x: '{:.3f}'.format(round(x, 3)), (x, y, r)))
Traceback (most recent call last): File "/tmp/tmpi_13wuk3/tmpnrt6pm7v.py", line 8, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s066672060
p00010
u868716420
1493773116
Python
Python3
py
Runtime Error
0
0
706
from math import sqrt for _ in range(int(input())) : x1, y1, x2, y2, x3, y3 = [float(temp) for temp in input().split()] a = [x1, y1, (x1 ** 2) + (y1 ** 2)] b = [x2, y2, (x2 ** 2) + (y2 ** 2)] c = [x3, y3, (x3 ** 2) + (y3 ** 2)] a1 = [(b[0] - a[0]), (b[1] - a[1]), (b[2] - a[2])] b1 = [(c[0] - a[0]), (c[1] - a[1]), (c[2] - a[2])] a1[1], a1[2] = (a1[1] / a1[0]), (a1[2] / a1[0]) b1[1], b1[2] = (b1[1] / b1[0]), (b1[2] / b1[0]) m = -(a1[2] - b1[2]) / (a1[1] - b1[1]) l = -(a1[1] * m + a1[2]) n = -((l * a[0]) + (m * a[1]) + a[2]) px = -l / 2 py = -m / 2 r = sqrt(((l / 2) ** 2)+((m / 2) ** 2)+n) print('{:0.3f} {:0.3f} {:0.3f}'.format(px, py, r))
Traceback (most recent call last): File "/tmp/tmp288t8v0r/tmpzlp4gjni.py", line 2, in <module> for _ in range(int(input())) : ^^^^^^^ EOFError: EOF when reading a line
s655692986
p00010
u957021183
1504763070
Python
Python3
py
Runtime Error
0
0
985
# Aizu Problem 0010: Circumscribed Circle of a Triangle # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") def circumscribed_circle(x1, y1, x2, y2, x3, y3): d = 2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) px = ( (x1**2 + y1**2) * (y2 - y3) + (x2**2 + y2**2) * (y3 - y1) + (x3**2 + y3**2) * (y1 - y2) ) / d py = ( (x1**2 + y1**2) * (x3 - x2) + (x2**2 + y2**2) * (x1 - x3) + (x3**2 + y3**2) * (x2 - x1) ) / d A = .5 * abs((x2 - x1) * (y3 - y1) - (x3 - x1) * (y1 - y1)) a = math.sqrt((x1 - x2)**2 + (y1 - y2)**2) b = math.sqrt((x1 - x3)**2 + (y1 - y3)**2) c = math.sqrt((x2 - x3)**2 + (y2 - y3)**2) r = a * b * c / (4 * A) return px, py, r N = int(input()) for k in range(N): x1, y1, x2, y2, x3, y3 = [float(_) for _ in input().split()] px, py, r = circumscribed_circle(x1, y1, x2, y2, x3, y3) print("%.3f %.3f %.3f" % (px, py, r))
Traceback (most recent call last): File "/tmp/tmp6mc8z5zv/tmpnru16_wc.py", line 23, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s842545166
p00010
u395334793
1505643997
Python
Python
py
Runtime Error
0
0
305
for _ in [0]*int(input()): a,d,b,e,c,f=map(float,input().split()) z=2*(b*f-c*e+c*d-a*f+a*e-b*d) x=((e-f)*(a**2+d**2)+(f-d)*(b**2+e**2)+(d-e)*(c**2+f**2))/z y=((c-b)*(a**2+d**2)+(a-c)*(b**2+e**2)+(b-a)*(c**2+f**2))/z print('{0:.3f} {1:.3f} {2:.3f}'.format(x,y,((a-x)**2+(d-y)**2)**0.5))
Traceback (most recent call last): File "/tmp/tmp_8vxbcpr/tmpo0fvwl20.py", line 1, in <module> for _ in [0]*int(input()): ^^^^^^^ EOFError: EOF when reading a line
s386945215
p00010
u933096856
1505825731
Python
Python3
py
Runtime Error
0
0
235
for i in range(n): x1,y1,x2,y2,x3,y3=map(float, input().split()) x4,y4=0.5*(x2+x3), 0.5*(y2+y3) xg,yg=2/3*(2*x1+x4), 2/3*(2*y1+y4) xo,yo=(x1+x2+x3)/3, (y1+y2+y3)/3 r=((xo-x1)**2+(yo-y1)**2)**0.5 print(xg, yg, r)
Traceback (most recent call last): File "/tmp/tmps8n2vtv6/tmp33vmsmp4.py", line 1, in <module> for i in range(n): ^ NameError: name 'n' is not defined
s456535820
p00010
u548155360
1512388589
Python
Python3
py
Runtime Error
0
0
1911
# coding=utf-8 import math if __name__ == '__main__': n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) points_list = [[x1, y1], [x2, y2], [x3, y3]] points_list.sort() print(points_list) if points_list[0][0] == points_list[1][0]: py = (points_list[0][1] + points_list[1][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 elif points_list[1][0] == points_list[2][0]: py = (points_list[1][1] + points_list[2][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 else: a1_s = (points_list[1][1] - points_list[0][1])/(points_list[1][0] - points_list[0][0]) a1 = -1/a1_s a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1 / a2_s m12x = (points_list[0][0] + points_list[1][0]) / 2 m12y = (points_list[0][1] + points_list[1][1]) / 2 m13x = (points_list[0][0] + points_list[2][0]) / 2 m13y = (points_list[0][1] + points_list[2][1]) / 2 b1 = m12y - a1 * m12x b2 = m13y - a2 * m13x px = (b2 - b1)/(a1 - a2) py = a1*px + b1 r = math.sqrt(math.pow((px-points_list[0][0]), 2) + math.pow((py-points_list[0][1]), 2)) print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))
Traceback (most recent call last): File "/tmp/tmpxomlmt9t/tmpjlo6reon.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s815708549
p00010
u548155360
1512388703
Python
Python3
py
Runtime Error
0
0
1909
# coding=utf-8 import math if __name__ == '__main__': n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) points_list = [[x1, y1], [x2, y2], [x3, y3]] points_list.sort() print(points_list) if points_list[0][0] == points_list[1][0]: py = (points_list[0][1] + points_list[1][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 elif points_list[1][0] == points_list[2][0]: py = (points_list[1][1] + points_list[2][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 else: a1_s = (points_list[1][1] - points_list[0][1])/(points_list[1][0] - points_list[0][0]) a1 = -1/a1_s a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m12x = (points_list[0][0] + points_list[1][0]) / 2 m12y = (points_list[0][1] + points_list[1][1]) / 2 m13x = (points_list[0][0] + points_list[2][0]) / 2 m13y = (points_list[0][1] + points_list[2][1]) / 2 b1 = m12y - a1 * m12x b2 = m13y - a2 * m13x px = (b2 - b1)/(a1 - a2) py = a1*px + b1 r = math.sqrt(math.pow((px-points_list[0][0]), 2) + math.pow((py-points_list[0][1]), 2)) print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))
Traceback (most recent call last): File "/tmp/tmpzz5act85/tmpucmj8yo9.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s856122872
p00010
u548155360
1512388745
Python
Python3
py
Runtime Error
0
0
1882
# coding=utf-8 import math if __name__ == '__main__': n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) points_list = [[x1, y1], [x2, y2], [x3, y3]] points_list.sort() if points_list[0][0] == points_list[1][0]: py = (points_list[0][1] + points_list[1][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 elif points_list[1][0] == points_list[2][0]: py = (points_list[1][1] + points_list[2][1])/2 a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 else: a1_s = (points_list[1][1] - points_list[0][1])/(points_list[1][0] - points_list[0][0]) a1 = -1/a1_s a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m12x = (points_list[0][0] + points_list[1][0]) / 2 m12y = (points_list[0][1] + points_list[1][1]) / 2 m13x = (points_list[0][0] + points_list[2][0]) / 2 m13y = (points_list[0][1] + points_list[2][1]) / 2 b1 = m12y - a1 * m12x b2 = m13y - a2 * m13x px = (b2 - b1)/(a1 - a2) py = a1*px + b1 r = math.sqrt(math.pow((px-points_list[0][0]), 2) + math.pow((py-points_list[0][1]), 2)) print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))
Traceback (most recent call last): File "/tmp/tmp60vzd4jo/tmpbhbbr7g4.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s024542183
p00010
u548155360
1512394837
Python
Python3
py
Runtime Error
0
0
2200
# coding=utf-8 import math if __name__ == '__main__': n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) points_list = [[x1, y1], [x2, y2], [x3, y3]] points_list.sort() if points_list[0][0] == points_list[1][0]: py = (points_list[0][1] + points_list[1][1])/2 if points_list[2][1] == points_list[0][1]: px = (points_list[0][0] + points_list[2][0])/2 else: a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 elif points_list[1][0] == points_list[2][0]: py = (points_list[1][1] + points_list[2][1])/2 if points_list[2][1] == points_list[0][1]: px = (points_list[0][0]+points_list[2][0])/2 else: a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m13x = (points_list[0][0] + points_list[2][0])/2 m13y = (points_list[0][1] + points_list[2][1])/2 b2 = m13y - a2*m13x px = (py - b2)/a2 else: a1_s = (points_list[1][1] - points_list[0][1])/(points_list[1][0] - points_list[0][0]) a1 = -1/a1_s a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0]) a2 = -1/a2_s m12x = (points_list[0][0] + points_list[1][0]) / 2 m12y = (points_list[0][1] + points_list[1][1]) / 2 m13x = (points_list[0][0] + points_list[2][0]) / 2 m13y = (points_list[0][1] + points_list[2][1]) / 2 b1 = m12y - a1 * m12x b2 = m13y - a2 * m13x px = (b2 - b1)/(a1 - a2) py = a1*px + b1 r = math.sqrt(math.pow((px-points_list[0][0]), 2) + math.pow((py-points_list[0][1]), 2)) print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))
Traceback (most recent call last): File "/tmp/tmpiqxq6gu1/tmpg5812jp6.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s209276934
p00010
u150984829
1516781312
Python
Python3
py
Runtime Error
0
0
270
for _ in[0]*int(input()): a,b,c,d,e,f=map(int,input().split()) x=((a*a+b*b)*(d-f)+(c*c+d*d)*(f-b)+(e*e+f*f)*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d)) y=((a*a+b*b)*(c-d)+(c*c+d*d)*(e-a)+(e*e+f*f)*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c)) print(f"{x:.4} {y:.4} {(x*x+y*y)**.5:.4}")
Traceback (most recent call last): File "/tmp/tmpsb0d8z6f/tmpx17_wv0s.py", line 1, in <module> for _ in[0]*int(input()): ^^^^^^^ EOFError: EOF when reading a line
s645411869
p00010
u150984829
1516782443
Python
Python3
py
Runtime Error
0
0
282
for _ in[0]*int(input()): a,b,c,d,e,f=map(float,input().split()) x=((a*a+b*b)*(d-f)+(c*c+d*d)*(f-b)+(e*e+f*f)*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d)) y=((a*a+b*b)*(c-e)+(c*c+d*d)*(e-a)+(e*e+f*f)*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c)) print('.3f %.3f %.3f'%(x,y,((x-a)**2+(y-b)**2)**.5))
Traceback (most recent call last): File "/tmp/tmp2t0ihmsk/tmpva47n5ye.py", line 1, in <module> for _ in[0]*int(input()): ^^^^^^^ EOFError: EOF when reading a line
s493329395
p00010
u150984829
1516782714
Python
Python3
py
Runtime Error
0
0
275
import math for _ in[0]*int(input()): a,b,c,d,e,f=map(float,input().split()) s,t,u=a*a+b*b,c*c+d*d,e*e+f*f x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d)) y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c)) print('%.3f %.3f %.3f'%(x,y,math.hypot(x-a,y-b)))
File "/tmp/tmpth0up50r/tmpyicy612v.py", line 7 print('%.3f %.3f %.3f'%(x,y,math.hypot(x-a,y-b))) ^ SyntaxError: invalid non-printable character U+001C