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
s194568711
p03992
u849957366
1474772200
Python
Python (3.4.3)
py
Runtime Error
23
3064
71
if __name__ == "__main__": print (S[:4].upper() + " " + S[4:].upper())
Traceback (most recent call last): File "/tmp/tmpifkv8vsk/tmphdlxajo5.py", line 2, in <module> print (S[:4].upper() + " " + S[4:].upper()) ^ NameError: name 'S' is not defined
s396571313
p03992
u921249617
1474772039
Python
Python (3.4.3)
py
Runtime Error
23
3064
355
s = list(input()) K = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" for i in range(len(s)): if K >= 26 or s[i] >= alphabet[-K]: K -= ord("z") - ord(s[i]) + 1 s[i] = "a" if K > 0: K %= 26 if (chr(ord(s[-1]) + K) <= "z"): s[-1] = chr(ord(s[-1]) + K) else: s[-1] = chr(ord("a") + K) print("".join(s))
Traceback (most recent call last): File "/tmp/tmp8lu74dx7/tmp61mz1pds.py", line 1, in <module> s = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s680955332
p03992
u794929569
1474771984
Python
Python (3.4.3)
py
Runtime Error
22
3188
147
s1 = input() s2 = input() s2 = s2.split(" ") f = 0 for a,b in enumerate(s2): if str(s2[int(b)-1]) == str(a+1): f = f+1 print (int(f/2))
Traceback (most recent call last): File "/tmp/tmpf8bx6jk_/tmphx9ettqx.py", line 1, in <module> s1 = input() ^^^^^^^ EOFError: EOF when reading a line
s488159452
p03992
u921249617
1474771972
Python
Python (3.4.3)
py
Runtime Error
23
3064
610
s = list(input()) K = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" # need = 0 # for i in range(len(s)): # need += ord("z") - ord(s[i]) + 1 for i in range(len(s)): if K >= 26 or s[i] >= alphabet[-K]: K -= ord("z") - ord(s[i]) + 1 s[i] = "a" if K > 0: K %= 26 if (chr(ord(s[-1]) + K) <= "z"): s[-1] = chr(ord(s[-1]) + K) else: s[-1] = chr(ord("a") + K) # if K > 0: # K %= 26 # if (ord(s[-1]) + K <= ord("z")): # s[-1] = chr(ord(s[-1]) + K) # else: # s[-1] = chr(ord("a") + K - (ord("z" - ord(s[-1])))) print("".join(s))
Traceback (most recent call last): File "/tmp/tmpfwvv9saf/tmpk8g2eqa9.py", line 1, in <module> s = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s864732183
p03992
u564917060
1474771694
Python
Python (3.4.3)
py
Runtime Error
33
3444
648
from collections import deque def next_char_ascii_num(c, k): n = ord(c) + (k % 26) if n <= 122: return n else: return n % 123 + 97 s = input() k = int(input()) d = deque() l = len(s) for x in s: if k == 0: d.append(ord(x)) else: if k >= 25 and l != 1: d.append(97) k -= (26 - (ord(x) - 97)) else: v =[next_char_ascii_num(x, y) for y in range(k + 1)] min_index = v.index(min(v)) d.append(v[min_index]) k -= min_index if k > 0: d[-1] = next_char_ascii_num(chr(d[-1]), k) print("".join([chr(x) for x in d]))
Traceback (most recent call last): File "/tmp/tmpglmbr8ue/tmpgvpe7348.py", line 10, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s324546116
p03992
u921249617
1474771648
Python
Python (3.4.3)
py
Runtime Error
23
3064
458
s = list(input()) K = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" # need = 0 # for i in range(len(s)): # need += ord("z") - ord(s[i]) + 1 for i in range(len(s)): if K >= 26 or s[i] >= alphabet[-K]: K -= ord("z") - ord(s[i]) + 1 s[i] = "a" if K > 0: K %= 26 if (ord(s[-1]) + K <= ord("z")): s[-1] = chr(ord(s[-1]) + K) else: s[-1] = chr(ord("a") + K - (ord("z" - ord(s[-1])))) print("".join(s))
Traceback (most recent call last): File "/tmp/tmp5g4tcmmu/tmpoaa4pr9v.py", line 1, in <module> s = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s846743011
p03992
u921249617
1474771567
Python
Python (3.4.3)
py
Runtime Error
23
3064
458
s = list(input()) K = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" # need = 0 # for i in range(len(s)): # need += ord("z") - ord(s[i]) + 1 for i in range(len(s)): if K >= 26 or s[i] >= alphabet[-K]: K -= ord("z") - ord(s[i]) + 1 s[i] = "a" if K > 0: K %= 26 if (ord(s[-1] + K <= ord("z"))): s[-1] = chr(ord(s[-1]) + K) else: s[-1] = chr(ord("a") + K - (ord("z" - ord(s[-1])))) print("".join(s))
Traceback (most recent call last): File "/tmp/tmp40_3m2s8/tmp0kzjjr9t.py", line 1, in <module> s = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s138394021
p03992
u765568504
1474771246
Python
Python (2.7.6)
py
Runtime Error
16
2568
248
n = int(raw_input()) s = raw_input() aa = s.split(" ") aaa = [] for i in range(n): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: # aaa.remove((a,b)) # aaa.remove((b,a)) ctr = ctr + 1 ctr = ctr / 2 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmp_qyrqdks/tmp6x9zn22b.py", line 1, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s729669704
p03992
u223058900
1474771035
Python
Python (2.7.6)
py
Runtime Error
16
2568
161
N = input(); a = raw_input().split(); a.insert(0, 0); ` count = 0; for i in range(1, N+1): if (i == int(a[int(a[i])])): count += 1; print count / 2
File "/tmp/tmpzdzp4bra/tmpl6qaefim.py", line 5 ` ^ SyntaxError: invalid syntax
s212059623
p03992
u765568504
1474771004
Python
Python (2.7.6)
py
Runtime Error
16
2568
263
n = int(raw_input()) s = raw_input() aa = s.split(" ") aaa = [] for i in range(n): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if a == b: aaa.remove((a,b)) if (b,a) in aaa: aaa.remove((a,b)) aaa.remove((b,a)) ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmprpyp54ig/tmpxjvi1om2.py", line 1, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s883540883
p03992
u223058900
1474770952
Python
Python (2.7.6)
py
Runtime Error
17
2568
168
N = input(); a = raw_input().split(); a.insert(0, 0); print a; count = 0; for i in range(1, N+1): if (i == int(a[int(a[i])])): count += 1; print count / 2
File "/tmp/tmpdh1op66c/tmpuf3cxzid.py", line 4 print a; ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s142102876
p03992
u765568504
1474770863
Python
Python (2.7.6)
py
Runtime Error
16
2568
231
n = int(raw_input()) s = raw_input() aa = s.split(" ") aaa = [] for i in range(n): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: aaa.remove((a,b)) aaa.remove((b,a)) ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmp1dm7xi1k/tmpu1dct1m4.py", line 1, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s692040896
p03992
u199479035
1474770860
Python
Python (3.4.3)
py
Runtime Error
22
3064
213
n = input() s = list(input()) a = {} for i in range(1,int(n)+1): a[i] = int(s[2*i-2]) result = 0 for i in range(1,int(n)+1): if a[a[i]] == i: result = result+1 result = int(result/2) print(result)
Traceback (most recent call last): File "/tmp/tmpvzaka6sy/tmplh8rz8s7.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s130286618
p03992
u765568504
1474770605
Python
Python (2.7.6)
py
Runtime Error
16
2568
275
n = int(raw_input()) print(str(n)) # a = raw_input() # aa = a.split(" ") # aaa = [] # for i in range(len(aa)): # aaa.append((i+1,int(aa[i]))) # ctr = 0 # for (a,b) in aaa: # if (b,a) in aaa: # aaa.remove((a,b)) # aaa.remove((b,a)) # ctr = ctr + 1 # print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpacswjyfv/tmpuvvhdxsd.py", line 1, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s418106258
p03992
u476127533
1474770593
Python
Python (3.4.3)
py
Runtime Error
23
3064
271
N = int(raw_input()) a = map(int, raw_input().split(" ")) b = [-1] a = b + a #print a count = 0 for i in range(1,N+1): #print a.index(a[int(a[i])]) if i == a[a[i]] and a.index(a[a[i]]) == a[i]: count +=1 a[i] = 0 a[(a[i])] = 0 print count
File "/tmp/tmpohhp_623/tmp3__xq7kx.py", line 14 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s551371017
p03992
u765568504
1474770577
Python
Python (2.7.6)
py
Runtime Error
17
2568
237
n = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: aaa.remove((a,b)) aaa.remove((b,a)) ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpdwrewykk/tmpa3kionkl.py", line 1, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s343853064
p03992
u765568504
1474770542
Python
Python (2.7.6)
py
Runtime Error
16
2568
261
N = int(raw_input()) # a = raw_input() # aa = a.split(" ") # aaa = [] # for i in range(len(aa)): # aaa.append((i+1,int(aa[i]))) # ctr = 0 # for (a,b) in aaa: # if (b,a) in aaa: # aaa.remove((a,b)) # aaa.remove((b,a)) # ctr = ctr + 1 # print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpjauz_4l3/tmpmpjguceh.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s252748691
p03992
u765568504
1474770522
Python
Python (2.7.6)
py
Runtime Error
16
2568
251
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] # for i in range(len(aa)): # aaa.append((i+1,int(aa[i]))) ctr = 0 # for (a,b) in aaa: # if (b,a) in aaa: # aaa.remove((a,b)) # aaa.remove((b,a)) # ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpoibleyj5/tmp19u30qnl.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s055664390
p03992
u765568504
1474770493
Python
Python (2.7.6)
py
Runtime Error
17
2568
247
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 # for (a,b) in aaa: # if (b,a) in aaa: # aaa.remove((a,b)) # aaa.remove((b,a)) # ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpqxk_ocsm/tmp0p_z6jr6.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s860602804
p03992
u849957366
1474770408
Python
PyPy3 (2.4.0)
py
Runtime Error
214
38640
83
import sys if __name__ == "__main__": S = sys.argv[1] print (S[:4] + " " + S[4:])
Traceback (most recent call last): File "/tmp/tmpsydx3otl/tmp0z_4b5he.py", line 3, in <module> S = sys.argv[1] ~~~~~~~~^^^ IndexError: list index out of range
s723447582
p03992
u483182857
1474769973
Python
Python (3.4.3)
py
Runtime Error
23
3064
259
s=input() list=[] k=int(input()) for i in range(len(s)-1): if (ord(s[i])+k)>122: list.append('a') k=k-(123-ord(s[i])) else: list.append(s[i]) list.append(chr(ord(s[len(s)])+k)) for i in range(len(s)): print(list[i], end='')
Traceback (most recent call last): File "/tmp/tmp4yzhw3pa/tmp8mvdcqof.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s325651729
p03992
u436484848
1474769031
Python
Python (3.4.3)
py
Runtime Error
24
3064
308
#C-Next Letter str = input() K = int(input()) tempK = K result = "" for i in range(len(str)): changeNum = 122-ord(str[i])+1 if (changeNum <= tempK): result += "a" tempK -= changeNum else: result += str[i] if (tempK != 0): tempK %= 26 result = result[:-1] + chr(ord(str[-1]) + tempK) print(result)
Traceback (most recent call last): File "/tmp/tmptqjk_wv5/tmpwcysudmh.py", line 2, in <module> str = input() ^^^^^^^ EOFError: EOF when reading a line
s716123869
p03992
u794929569
1474768950
Python
Python (3.4.3)
py
Runtime Error
22
3064
153
s1 = raw_input() s2 = raw_input() s2 = s2.split(" ") f = 0 for a,b in enumerate(s2): if str(s2[int(b)-1]) == str(a+1): f = f+1 print str(f/2)
File "/tmp/tmpdkalz3cf/tmprh5clzom.py", line 8 print str(f/2) ^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s104952364
p03992
u794929569
1474768874
Python
Python (3.4.3)
py
Runtime Error
22
3068
157
s1 = raw_input() s2 = raw_input() s2 = s2.split(" ") f = 0 print s2 for a,b in enumerate(s2): if str(s2[int(b)-1]) == str(a+1): f = f+1 print f/2
File "/tmp/tmpq2ax5idz/tmpt0umws07.py", line 5 print s2 ^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s231302424
p03992
u765568504
1474768773
Python
Python (2.7.6)
py
Runtime Error
16
2568
237
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: aaa.remove((a,b)) aaa.remove((b,a)) ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpt9eiv15i/tmpjmrjcu6y.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s039300051
p03992
u765568504
1474768699
Python
Python (2.7.6)
py
Runtime Error
17
2568
237
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: aaa.remove((a,b)) aaa.remove((b,a)) ctr = ctr + 1 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpecx5fu1q/tmp111nr4ab.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s606850175
p03992
u765568504
1474768467
Python
Python (2.7.6)
py
Runtime Error
16
2568
211
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (a,b) in aaa: if (b,a) in aaa: ctr = ctr + 1 ctr = ctr / 2 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmp4q5ajzje/tmpgskliiyy.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s346884725
p03992
u425812948
1474768397
Python
Python (3.4.3)
py
Runtime Error
23
3064
475
S = str(input()) K = int(input()) arr = [ord(S[i]) for i in range(len(S))] count = K for i in range(len(S)): if i == len(S) - 1: count %= 26 if ord('z') - arr[i] + 1 <= count: arr[i] = ord('a') count -= ord('z') - ord(S[i]) + 1 arr[i] += count break if ord('z') - arr[i] + 1 <= count: arr[i] = ord('a') count -= (ord('z') - ord(S[i]) + 1) ans = '' for c in arr: ans += chr(c) print(ans)
Traceback (most recent call last): File "/tmp/tmpds5bhogb/tmpp194gr2u.py", line 1, in <module> S = str(input()) ^^^^^^^ EOFError: EOF when reading a line
s031056942
p03992
u869081502
1474768250
Python
Python (2.7.6)
py
Runtime Error
16
2568
70
def add_space(s): s=s[:4] + " " + s[4:] return s add_space(s)
Traceback (most recent call last): File "/tmp/tmpwkp8_7rn/tmpjhvxm1_q.py", line 5, in <module> add_space(s) ^ NameError: name 's' is not defined
s796524669
p03992
u454377662
1474768202
Python
Python (2.7.6)
py
Runtime Error
16
2568
121
import sys def solution(s): return s[:4] + ' ' + s[4:] if __name__ == '__main__': print(solution(sys.argv[1]))
Traceback (most recent call last): File "/tmp/tmp9w1b7ssg/tmp3pcj_onu.py", line 7, in <module> print(solution(sys.argv[1])) ~~~~~~~~^^^ IndexError: list index out of range
s083386569
p03992
u454377662
1474768110
Python
Python (3.4.3)
py
Runtime Error
24
3064
121
import sys def solution(s): return s[:4] + ' ' + s[4:] if __name__ == '__main__': print(solution(sys.argv[1]))
Traceback (most recent call last): File "/tmp/tmp_qzhltrg/tmpk17qh1tn.py", line 7, in <module> print(solution(sys.argv[1])) ~~~~~~~~^^^ IndexError: list index out of range
s399925648
p03992
u112686013
1474768109
Python
Python (2.7.6)
py
Runtime Error
16
2568
278
s = list(raw_input()) k = int(raw_input()) for i in range(len(s)): numChanges = ord('z') - ord(s[i]) + 1 if s[i] != 'a' and numChanges <= k: s[i] = 'a' k -= numChanges if i == len(s) - 1: s[i] = chr(ord(s[i]) + (k % 26)) print ''.join(s)
File "/tmp/tmpvl6dekkt/tmpinflvx3q.py", line 13 print ''.join(s) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s066098998
p03992
u765568504
1474768104
Python
Python (2.7.6)
py
Runtime Error
16
2568
210
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (x,y) in aaa: if (y,x) in aaa: ctr = ctr + 1 ctr = ctr / 2 print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpgm82ala0/tmpg399qb42.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s006701867
p03992
u765568504
1474767988
Python
Python (2.7.6)
py
Runtime Error
16
2568
218
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (x,y) in aaa: if (y,x) in aaa: ctr = ctr + 1 aaa.remove( (y,x) ) print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpto16tide/tmpzwzzealz.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s902549748
p03992
u765568504
1474767871
Python
Python (2.7.6)
py
Runtime Error
16
2568
237
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (x,y) in aaa: if (y,x) in aaa: ctr = ctr + 1 aaa.remove( (y,x) ) aaa.remove((x,y)) print(str(ctr))
Traceback (most recent call last): File "/tmp/tmpybezk08c/tmpm2ns27w6.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s110738518
p03992
u765568504
1474767830
Python
Python (2.7.6)
py
Runtime Error
16
2568
232
N = int(raw_input()) a = raw_input() aa = a.split(" ") aaa = [] for i in range(len(aa)): aaa.append((i+1,int(aa[i]))) ctr = 0 for (x,y) in aaa: if (y,x) in aaa: ctr = ctr + 1 aaa.remove( (y,x) ) aaa.remove((x,y)) print(aaa)
Traceback (most recent call last): File "/tmp/tmprm_yabbk/tmprqh439ku.py", line 1, in <module> N = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s787517538
p03992
u592453979
1474767791
Python
Python (2.7.6)
py
Runtime Error
16
2568
439
def needed_to_flip(c): return ord('z') - ord(c) + 1 s = list(raw_input()) K = int(raw_input()) #s = list('za') #K = 4 for i, c in enumerate(s): if c == 'a': continue needed = needed_to_flip(c) #print "%s: needed: %d, has: %d" % (c, needed, K) if K >= needed: K -= needed s[i] = 'a' #print "flip: %s needed: %d, has: %d" % (s[i], needed,K) if i == len(s) - 1: s[i] = chr(ord(s[i]) + (K % 26)) print ''.join(s)
File "/tmp/tmpqjd8wz17/tmpikp3lczy.py", line 23 print ''.join(s) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s805346160
p03992
u869081502
1474767726
Python
Python (2.7.6)
py
Runtime Error
16
2568
35
s=s[:4] + " " + s[4:] return s
File "/tmp/tmp50409i4u/tmpxw98khj5.py", line 2 return s ^^^^^^^^ SyntaxError: 'return' outside function
s746389374
p03992
u451151895
1474767706
Python
Python (2.7.6)
py
Runtime Error
16
2580
39
s = raw_input print s[:4] + ' ' + s[4:]
File "/tmp/tmp10e1m8kz/tmpw9p84hxh.py", line 2 print s[:4] + ' ' + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s083046385
p03992
u794929569
1474767587
Python
Python (3.4.3)
py
Runtime Error
22
3064
370
// string::substr #include <iostream> #include <string> using namespace std; int main () { string str; cin >> str; // (quoting Alfred N. Whitehead) string str2 = str.substr (0,4); // "think" string str3 = str.substr (4); // get from "live" to the end cout << str2 << ' ' << str3 << '\n'; return 0; }
File "/tmp/tmp4crhdwo1/tmpnf1nyyh2.py", line 1 // string::substr ^^ SyntaxError: invalid syntax
s084907803
p03992
u869081502
1474767550
Python
Python (2.7.6)
py
Runtime Error
16
2568
53
if len(s)==12: s=s[:4] + " " + s[4:] print s
File "/tmp/tmp0l2nmz46/tmpy4suroa8.py", line 3 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s641176413
p03992
u849957366
1474767453
Python
PyPy3 (2.4.0)
py
Runtime Error
210
38640
52
if __name__ == "__main__": S = S[0:4] + " " + S[4:]
Traceback (most recent call last): File "/tmp/tmpod6wwjd8/tmptbgtx9tn.py", line 2, in <module> S = S[0:4] + " " + S[4:] ^ NameError: name 'S' is not defined
s290126953
p03992
u112686013
1474767447
Python
Python (2.7.6)
py
Runtime Error
16
2568
328
s = list(raw_input()) k = int(raw_input()) for i in range(len(s)): numChanges = ord('z') - ord(s[i]) + 1 if s[i] != 'a' and numChanges <= k: s[i] = chr(ord(s[i]) - 26 + numChanges) k -= numChanges elif i == len(s) - 1 and numChanges > k: s[i] = chr(ord(s[i]) + k) print ''.join(s)
File "/tmp/tmp0xgc6kzj/tmp5y8xruiw.py", line 13 print ''.join(s) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s232076459
p03992
u794929569
1474767423
Python
Python (3.4.3)
py
Runtime Error
23
3064
78
import sys a = sys.stdin.readlines() b = a[:4] c = a[4:] print (b+" "+c+"\n")
Traceback (most recent call last): File "/tmp/tmprs0ea0el/tmpp5lo4g5h.py", line 6, in <module> print (b+" "+c+"\n") ~^~~~ TypeError: can only concatenate list (not "str") to list
s601383430
p03992
u794929569
1474767335
Python
Python (3.4.3)
py
Runtime Error
23
3064
68
import sys a = sys.argv[1] b = a[:4] c = a[4:] print (b+" "+c+"\n")
Traceback (most recent call last): File "/tmp/tmpsuu1onxd/tmpmcd_d_4v.py", line 3, in <module> a = sys.argv[1] ~~~~~~~~^^^ IndexError: list index out of range
s958246001
p03992
u451151895
1474767229
Python
Python (2.7.6)
py
Runtime Error
16
2696
65
def cod(s): return s[:4] + ' ' + s[4:] k = sys.argv[1] cod(k)
Traceback (most recent call last): File "/tmp/tmp67ldccbk/tmp6p32ld51.py", line 3, in <module> k = sys.argv[1] ^^^ NameError: name 'sys' is not defined
s054008439
p03992
u794929569
1474767202
Python
Python (3.4.3)
py
Runtime Error
23
3064
70
import sys a = (sys.argv)[1] b = a[:4] c = a[4:] print (b+" "+c+"\n")
Traceback (most recent call last): File "/tmp/tmp0_qhf7v_/tmpi1_qjk6m.py", line 3, in <module> a = (sys.argv)[1] ~~~~~~~~~~^^^ IndexError: list index out of range
s337879846
p03992
u451151895
1474767166
Python
Python (2.7.6)
py
Runtime Error
16
2568
41
s = sys.argv[1] print s[:4] + ' ' + s[4:]
File "/tmp/tmpfc0rt91d/tmp5tewhlmt.py", line 2 print s[:4] + ' ' + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s753559874
p03992
u794929569
1474767094
Python
Python (3.4.3)
py
Runtime Error
22
3064
68
import sys a = sys.argv[1] b = a[:4] c = a[4:] print (a+" "+b+"\n")
Traceback (most recent call last): File "/tmp/tmpcd2suu8y/tmp7ldlnnz2.py", line 3, in <module> a = sys.argv[1] ~~~~~~~~^^^ IndexError: list index out of range
s680233700
p03992
u451151895
1474767086
Python
Python (2.7.6)
py
Runtime Error
18
2580
25
print s[:4] + ' ' + s[4:]
File "/tmp/tmpo1kv0df0/tmpmnh7qtsi.py", line 1 print s[:4] + ' ' + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s930167046
p03992
u544337787
1474767049
Python
Python (2.7.6)
py
Runtime Error
16
2568
336
moji = {a: b for a, b in zip("abcdefghijklmnopqrstuvwxyz", range(26))} s = list(raw_input()) k = int(raw_input()) for i, e in enumerate(s): if 26 - moji[e] <= k: s[i] = "a" k -= 26 - moji[e] k = k % 26 if k >= 0 else 0 if k != 0: s[-1] = "abcdefghijklmnopqrstuvwxyz"[(moji[s[-1]] + k) % 26] print "".join(s)
File "/tmp/tmpa2ks8h68/tmppjp90a9f.py", line 15 print "".join(s) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s739483447
p03992
u617054847
1474767033
Python
Python (2.7.6)
py
Runtime Error
17
2692
410
s = raw_input() k = int(raw_input()) opreq = [(ord('z') - ord(c) + 1) % 26 for c in s] s_ = [] if len(s) > 1: i = 0 while k > 0 and i < len(s) - 1: if opreq[i] < k: k = k - opreq[i] s_.append('a') else: s_.append(s[i]) i += 1 # Last character last_c = chr((k + ord(s[-1]) - ord('a')) % 26 + ord('a')) s_.append(last_c) print("".join(s_))
Traceback (most recent call last): File "/tmp/tmpv2456c3c/tmpr8ocie06.py", line 1, in <module> s = raw_input() ^^^^^^^^^ NameError: name 'raw_input' is not defined
s674981253
p03992
u765568504
1474766775
Python
Python (3.4.3)
py
Runtime Error
23
3064
50
s = raw_input() s2 = s[:4] + " " + s[4:] print(s2)
Traceback (most recent call last): File "/tmp/tmptvjf43zy/tmppsb_zkg5.py", line 1, in <module> s = raw_input() ^^^^^^^^^ NameError: name 'raw_input' is not defined
s222321416
p03992
u765568504
1474766753
Python
Python (3.4.3)
py
Runtime Error
23
3064
42
s = raw_input() print(s[:4] + " " + s[4:])
Traceback (most recent call last): File "/tmp/tmp8c04adfm/tmputon1pbz.py", line 1, in <module> s = raw_input() ^^^^^^^^^ NameError: name 'raw_input' is not defined
s210424140
p03992
u451151895
1474766743
Python
Python (2.7.6)
py
Runtime Error
15
2568
88
import sys def codefestival(s): return s[4:] + ' ' + s[4:] codefestival(sys.argv[1])
Traceback (most recent call last): File "/tmp/tmpnw5o70g_/tmpq9cyv9pw.py", line 4, in <module> codefestival(sys.argv[1]) ~~~~~~~~^^^ IndexError: list index out of range
s946690143
p03992
u765568504
1474766740
Python
Python (3.4.3)
py
Runtime Error
22
3064
41
s = raw_input() print s[:4] + " " + s[4:]
File "/tmp/tmpj7v_oy8x/tmpx3thxamd.py", line 2 print s[:4] + " " + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s764999689
p03992
u765568504
1474766700
Python
Python (3.4.3)
py
Runtime Error
23
3064
41
s = raw_input() print s[:4] + " " + s[4:]
File "/tmp/tmpbud_h9pq/tmpmtqf97o5.py", line 2 print s[:4] + " " + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s844119900
p03992
u765568504
1474766639
Python
Python (3.4.3)
py
Runtime Error
23
3064
41
s = raw_input() print(s[:4] + ' ' +s[4:])
Traceback (most recent call last): File "/tmp/tmp_571niwx/tmpmoiiw0hs.py", line 1, in <module> s = raw_input() ^^^^^^^^^ NameError: name 'raw_input' is not defined
s584375551
p03992
u842303434
1474766459
Python
Python (3.4.3)
py
Runtime Error
23
3064
145
n = int(input()) l = list(map(int, input().split())) cnt = 0 for i in range(n): if i == l[l[i] - 1] - 1: cnt+=1 cnt //= 2 print(cnt)
Traceback (most recent call last): File "/tmp/tmpcpmvr0gr/tmp2vkh552m.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s324627917
p03992
u100054963
1474766381
Python
Python (3.4.3)
py
Runtime Error
23
3188
236
N = int(input()) like_rabbits_list = list(map(int, input().split())) sum_of_pairs = 0 for i,rabbit in enumerate(like_rabbits_list): if like_rabbits_list[rabbit - 1] == (i+1): sum_of_pairs += 1 print (int(sum_of_pairs / 2))
Traceback (most recent call last): File "/tmp/tmpqsdsx0dz/tmp1g9inlf3.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s870941242
p03992
u451151895
1474766317
Python
Python (2.7.6)
py
Runtime Error
16
2568
25
print s[:4] + ' ' + s[4:]
File "/tmp/tmp7npfoyz2/tmpj1rm8bcl.py", line 1 print s[:4] + ' ' + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s826327416
p03992
u866788101
1474766199
Python
Python (2.7.6)
py
Runtime Error
16
2568
84
input = raw_input("please input:") output=input[0:4]+" "+output[:-8] println(output)
Traceback (most recent call last): File "/tmp/tmpa_b4mi4d/tmpxrw8lh3h.py", line 1, in <module> input = raw_input("please input:") ^^^^^^^^^ NameError: name 'raw_input' is not defined
s677489424
p03992
u842303434
1474766094
Python
Python (3.4.3)
py
Runtime Error
22
2940
56
s = input() s = s[:4] + ' ' + s[4:] print(s)
File "/tmp/tmp8irgld6c/tmp9z4yv3lf.py", line 1 s = input() IndentationError: unexpected indent
s856106758
p03992
u842303434
1474765912
Python
Python (3.4.3)
py
Runtime Error
22
3068
43
s = input() s = s[:4] + ' ' s[4:] print(s)
File "/tmp/tmphxyjyf8d/tmpnwpynp98.py", line 2 s = s[:4] + ' ' s[4:] ^ SyntaxError: invalid syntax
s662736732
p03992
u117240323
1474765505
Python
Python (3.4.3)
py
Runtime Error
23
3068
18
print(s[:4],s[4:])
Traceback (most recent call last): File "/tmp/tmphgujoc_5/tmphpo7ilxz.py", line 1, in <module> print(s[:4],s[4:]) ^ NameError: name 's' is not defined
s767505156
p03992
u327848404
1474765487
Python
Python (2.7.6)
py
Runtime Error
16
2568
45
S = raw_input() print S[0:4] + " " + s[4:12]
File "/tmp/tmp45094i69/tmpddam4wmj.py", line 3 print S[0:4] + " " + s[4:12] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s739967690
p03992
u199479035
1474765457
Python
Python (2.7.6)
py
Runtime Error
16
2568
39
s = input() print(s[:4]+' '+s[4:]+'\n')
Traceback (most recent call last): File "/tmp/tmpcl7g_v2_/tmpps0_h7ms.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s075867648
p03992
u451151895
1474765355
Python
Python (2.7.6)
py
Runtime Error
17
2572
26
return s[:4] + " " + s[4:]
File "/tmp/tmp4e0ta37s/tmpi9k6hvcl.py", line 1 return s[:4] + " " + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'return' outside function
s185953553
p03992
u199479035
1474765313
Python
Python (2.7.6)
py
Runtime Error
16
2568
34
s = input() print(s[:4]+' '+s[4:])
Traceback (most recent call last): File "/tmp/tmpoei2mjqw/tmp_2696uw4.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s471311588
p03992
u045939752
1474765285
Python
Python (3.4.3)
py
Runtime Error
22
3064
43
s = raw_input() print s[0:4] + " " + s[4:]
File "/tmp/tmp2rsjwy9u/tmpgwscscxu.py", line 2 print s[0:4] + " " + s[4:] ^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s882128022
p03992
u422104747
1474765251
Python
Python (3.4.3)
py
Runtime Error
22
3064
37
s=input ss=s[0:3]+" "+s[4:] print(ss)
Traceback (most recent call last): File "/tmp/tmpzq6lvj0q/tmp6chuba4k.py", line 2, in <module> ss=s[0:3]+" "+s[4:] ~^^^^^ TypeError: 'builtin_function_or_method' object is not subscriptable
s684885299
p03993
u626337957
1600922103
Python
PyPy3 (7.3.0)
py
Runtime Error
103
85580
169
N = int(input()) nums = list(map(int, input().split())) answer = 0 for i, num in enumerate(nums, start=1): if i == nums[num] and i < num: answer += 1 print(answer)
Traceback (most recent call last): File "/tmp/tmpf5jj1lw9/tmpbevz67sv.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s389129208
p03993
u744034042
1598735392
Python
PyPy3 (7.3.0)
py
Runtime Error
101
84700
269
N = int(input()) A = list(map(lambda x:int(x)-1,input().split())) ans = 0 paired = [] for i in range(n): if i in paired: continue else: if A[A[i]] == i: ans += 1 paired.append(i) paired.append(A[i]) print(ans)
Traceback (most recent call last): File "/tmp/tmpm85lmpux/tmp8shxc6kb.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s456622262
p03993
u625549378
1597803351
Python
Python (3.8.2)
py
Runtime Error
78
20348
220
N = int(input()) rabit = [ int(v) for v in input().split(" ") ] skip = set() num = 0 for i in range(N): n = rabit[i] if i in skip: continue if rabit[n-1] == i+1: skip.append(n-1) num += 1 print(num)
Traceback (most recent call last): File "/tmp/tmplfdwzrzs/tmpo5w3wayy.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s496794137
p03993
u201660334
1597378946
Python
Python (3.8.2)
py
Runtime Error
44
20612
135
n = int(input()) a = list(map(int, input().split())) ans = 0 for i in range(a): if a[a[i] - 1] == i + 1: ans += 1 print(ans // 2)
Traceback (most recent call last): File "/tmp/tmp5vehkz1m/tmp546kw3zt.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s030854617
p03993
u247211039
1594069902
Python
Python (3.8.2)
py
Runtime Error
27
8792
245
#N = int(input()) #a = list(map(int, input().split())) ans=0 if N%2==0: for i in range(N//2): if a[a[i]-1]==i+1: ans += 1 else: for i in range(N//2 +1): if a[a[i]-1]==i+1: ans+=1 print(ans)
Traceback (most recent call last): File "/tmp/tmpexub39e3/tmp91dve5d7.py", line 6, in <module> if N%2==0: ^ NameError: name 'N' is not defined
s584263497
p03993
u247211039
1594069762
Python
Python (3.8.2)
py
Runtime Error
24
8928
228
N = int(input()) a = list(map(int, input().split())) ans=0 if N%2==0: for i in range(N//2): if a[a[i]-1]==i+1: ans += 1 else: for i in range(N//2 +1): if a[a[i]-1]==i+1: ans+=1
File "/tmp/tmp97_f6m4f/tmp0vbyyz7e.py", line 9 ans += 1 ^ IndentationError: unindent does not match any outer indentation level
s736426847
p03993
u247211039
1594069726
Python
Python (3.8.2)
py
Runtime Error
26
8976
228
N = int(input()) a = list(map(int, input().split())) ans=0 if N%2==0: for i in range(N//2): if a[a[i]-1]==i+1: ans += 1 else: for i in range(N//2 +1): if a[a[i]-1]==i+1: ans+=1
File "/tmp/tmpw8kw5qww/tmpcb6sjmqy.py", line 9 ans += 1 TabError: inconsistent use of tabs and spaces in indentation
s003213909
p03993
u089121621
1594068423
Python
Python (3.8.2)
py
Runtime Error
46
20676
192
n = int(input()) l = [list(map(int, input().split())) for _ in range(n)] l = l[0] cnt = 0 for i in range(n): if l[i]-1 > i: if( l[l[i]-1]-1 == i): cnt+=1 print(cnt)
Traceback (most recent call last): File "/tmp/tmp3aejc7m4/tmpsqx2lbth.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s368737521
p03993
u193927973
1593275921
Python
Python (3.8.2)
py
Runtime Error
46
20596
121
N=int(input()) A=list(map(int, input().split())) ans=0 for i in range(N): if A[a[i-1]-1]==i+1: ans+=1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmpnih0ibd0/tmp681r5vp4.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s801110105
p03993
u090406054
1593210911
Python
Python (3.8.2)
py
Runtime Error
58
20596
117
n=int(input()) a=list(map(int,input().split())) cnt=0 for i in range(n): if a[a[i+1]+1]==i+1: cnt+=1 print(cnt)
Traceback (most recent call last): File "/tmp/tmp3nvtj83k/tmpygr2ftvq.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s707785707
p03993
u274635633
1591086756
Python
Python (3.4.3)
py
Runtime Error
41
14008
108
n=int(input()) a=[0]+list(map(int,input().split())) ans=0 for i in n: if a[a[i]]==i: ans+=1 print(ans)
Traceback (most recent call last): File "/tmp/tmpdvw08mvt/tmpev5bm456.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s975588213
p03993
u227085629
1590673677
Python
Python (3.4.3)
py
Runtime Error
54
13880
118
n = int(input()) a = list(map(int,input().split())) c = 0 for i in range(n): if i == a[a[i]]: c += 1 print(c//2)
Traceback (most recent call last): File "/tmp/tmpbxuol12q/tmpzopee7i7.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s015303052
p03993
u633355062
1590099839
Python
PyPy3 (2.4.0)
py
Runtime Error
212
52316
425
import sys readline = sys.stdin.readline readlines = sys.stdin.readlines ns = lambda: readline().rstrip() # input string ni = lambda: int(readline().rstrip()) # input int nm = lambda: map(int, readline().split()) # input multiple int nl = lambda: list(map(int, readline().split())) # input multiple int to list n = ni() l = nl() ans = 0 for i, usa in enumerate(l): if l[usa] - 1 == i: ans += 1 print(ans // 2)
Traceback (most recent call last): File "/tmp/tmp_enri7ll/tmp6bo16bng.py", line 10, in <module> n = ni() ^^^^ File "/tmp/tmp_enri7ll/tmp6bo16bng.py", line 6, in <lambda> ni = lambda: int(readline().rstrip()) # input int ^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s289413382
p03993
u663438907
1589323961
Python
Python (3.4.3)
py
Runtime Error
690
2007352
220
import numpy as np import collections N = int(input()) a = list(map(int, input().split())) l = np.zeros((N, N)) for i in range(N): l[i][a[i]-1] += 1 lt = l.T sum_l = l + lt print(len(list(sum_l[sum_l == 2]))//2)
Traceback (most recent call last): File "/tmp/tmp47iq0zzs/tmp5r84bumh.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s485126186
p03993
u652656291
1589299081
Python
Python (3.4.3)
py
Runtime Error
60
14008
138
n = int(input()) A = list(map(int,input().split())) ans = 0 for i in range(n): b = A[i] if i+1 == A[b]: ans += 1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmp4xuh0lg0/tmp4lp142fc.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s842074132
p03993
u652656291
1589299052
Python
Python (3.4.3)
py
Runtime Error
57
14008
130
n = int(input()) A = list(map(int,input().split())) ans = 0 for i in range(n): if i+1 == A[A[i]]: ans += 1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmp2ljxane3/tmpn8woayn_.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s329683916
p03993
u711238850
1588942728
Python
PyPy3 (2.4.0)
py
Runtime Error
176
42864
128
n = int(input()) a = tuple(map(lambda a:int(a)-1,input())) ans = 0 for i in range(n): if a[a[i]]==i: ans+=1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmp2xpexctv/tmp_j35edme.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s425950122
p03993
u667024514
1588938471
Python
Python (3.4.3)
py
Runtime Error
59
14008
132
n = int(input()) lis = list(map(int,input().split())) ans = 0 for i in range(n): if lis[lis[i]] == i+1: ans += 1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmpt6qxgv7i/tmpwo59lp8t.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s479255685
p03993
u141410514
1587785534
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
253388
252
n = int(input()) A = list(map(int,input().split())) cnt = 0 B = [False for _ in range(n)] for i,a in enumerate(A): print(A[a-1],i) print(B) if A[a-1] == i+1 and B[i] == False: cnt+=1 B[a-1] = True B[i] = True print(cnt)
Traceback (most recent call last): File "/tmp/tmpna6uwstp/tmpbd4vdte3.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s578229972
p03993
u148551245
1587242127
Python
Python (3.4.3)
py
Runtime Error
41
13880
180
n = int(input()) a = list(map(int, input().split())) like = {} ans = 0 for i, r in enumerate(a): like[i] = r if like.get(r, default=0) == i: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpzsr8jkbo/tmp81jpjn6m.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s506493038
p03993
u148551245
1587241169
Python
Python (3.4.3)
py
Runtime Error
17
2940
643
use std::io::stdin; use std::collections::BTreeMap; fn main() { let mut buf = String::new(); stdin().read_line(&mut buf).ok(); let n: usize = buf.trim().parse().ok().unwrap(); let mut buf = String::new(); stdin().read_line(&mut buf).ok(); let a = buf.split_whitespace().map(|x| x.parse().ok().unwrap()).collect::<Vec<usize>>(); let mut like = BTreeMap::new(); let mut ans = 0usize; for (i, t) in a.iter().enumerate() { let handle = like.entry(i+1).or_insert(0); *handle = *t; if like.get(t) == Some(&(i+1)) { ans += 1; } } println!("{}", ans); }
File "/tmp/tmptksfeq8w/tmp0rnnt8as.py", line 16 let mut ans = 0usize; ^ SyntaxError: invalid decimal literal
s300580413
p03993
u102242691
1584244629
Python
Python (3.4.3)
py
Runtime Error
19
4724
152
n = int(input()) a = list(map(int,input())) ans = 0 for i in range(n): j = a[i] -1 if a[j] == i + 1: ans += 1 print(ans // 2)
Traceback (most recent call last): File "/tmp/tmp60axzicu/tmpxiftlwwj.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s407345681
p03993
u667024514
1584013745
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
n =int(input()) lis =list(map(int,input().split())) ans =0 for i in range(n): if lis[lis[i]-1]=i+1: ans +=1 print(ans//2)
File "/tmp/tmpftniqbg4/tmpxxwvun03.py", line 5 if lis[lis[i]-1]=i+1: ^^^^^^^^^^^^^ SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
s832397420
p03993
u767664985
1583898281
Python
Python (3.4.3)
py
Runtime Error
40
14008
170
N = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for i in range(N): j = a[i] - 1 if i < j and a[j] - 1 == i: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmp32zr0hci/tmp46_q0jey.py", line 1, in <module> N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s996321900
p03993
u127499732
1581143320
Python
Python (3.4.3)
py
Runtime Error
56
14008
111
n=int(input()) a=list(map(int,input().split())) ans=0 for i in range(n): if a[a[i]]==i: ans+=1 print(ans)
Traceback (most recent call last): File "/tmp/tmpacrgupkd/tmpent5d5rr.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s567796108
p03993
u209619667
1579120864
Python
Python (3.4.3)
py
Runtime Error
2104
14008
161
p = int(input()) A = list(map(int,input().split())) a = list(range(1,p+1)) count = 0 for j,i in zip(a,A): if i == a[A.index(j)]: count += 1 print(count//2)
Traceback (most recent call last): File "/tmp/tmpphxjh_4d/tmp3tqovtm7.py", line 1, in <module> p = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s664486289
p03993
u905582793
1577420081
Python
Python (3.4.3)
py
Runtime Error
61
13880
124
n=int(input()) a=list(map(int,input().split())) ans=0 for i in range(n): j = a[i] if a[j] == i: ans+=1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmpov97l97m/tmp465nsz0s.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s523186818
p03993
u386819480
1575866740
Python
Python (3.4.3)
py
Runtime Error
307
29736
802
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10000000) INF = 1<<32 from bisect import bisect_left, bisect_right def solve(N: int, a: "List[int]"): x = [[i+1, a[i]] for i in range(N)] x = sorted(x, key=lambda x:x[1]) x1 = [i for i,j in x] x2 = [j for i,j in x] ans = 0 for i in range(N): p = bisect_left(x2, x1[i]) if x1[i] == x2[p]: if x2[i] == x1[p]: ans += 1 print(ans//2) return def main(): def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() N = int(next(tokens)) # type: int a = [int(next(tokens)) for _ in range(N)] # type: "List[int]" solve(N, a) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp1m_eb7oa/tmp3mwl96ew.py", line 38, in <module> main() File "/tmp/tmp1m_eb7oa/tmp3mwl96ew.py", line 33, in main N = int(next(tokens)) # type: int ^^^^^^^^^^^^ StopIteration
s211726145
p03993
u936985471
1573482503
Python
Python (3.4.3)
py
Runtime Error
41
13880
113
n=input() a=list(map(int,input().split())) ans=0 for i in range(n): if a[a[i]-1]-1==i: ans+=1 print(ans//2)
Traceback (most recent call last): File "/tmp/tmpk8j1hiqi/tmpibe6mpow.py", line 1, in <module> n=input() ^^^^^^^ EOFError: EOF when reading a line