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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s616498346 | p03993 | u623687794 | 1571854843 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
if a[a[i]-1]=i+1:ans+=1
print(ans) | File "/tmp/tmpg5lu8fku/tmpj8qklj_o.py", line 5
if a[a[i]-1]=i+1:ans+=1
^^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s892149512 | p03993 | u391731808 | 1563941348 | Python | Python (3.4.3) | py | Runtime Error | 19 | 4724 | 75 | input();*A,=map(int,input());print(sum(A[a]==i for i,a in enumerate(A))//2) | Traceback (most recent call last):
File "/tmp/tmp_84_73uh/tmp1jek0o2e.py", line 1, in <module>
input();*A,=map(int,input());print(sum(A[a]==i for i,a in enumerate(A))//2)
^^^^^^^
EOFError: EOF when reading a line
| |
s743674450 | p03993 | u014847113 | 1563000206 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 290 | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define df 0
int main(){
int n;
scanf("%d",&n);
int i,a[n+1];
for(i=0;i<n;i++)
scanf("%d",&a[i+1]);
int count=0;
for(i=1;i<=n;i++)
if(a[a[i]]==i)count++;
printf("%d",count/2);
return 0;
}
/// confirm df==0 /// | File "/tmp/tmpi1w6241i/tmp5yzulp_l.py", line 7
int main(){
^^^^
SyntaxError: invalid syntax
| |
s843641051 | p03993 | u170324846 | 1561344627 | Python | Python (3.4.3) | py | Runtime Error | 59 | 13880 | 121 | N = int(input())
a = [int(i) for i in input().split()]
S = 0
for i in range(N):
if a[a[i]] == i:
S += 1
print(S//2) | Traceback (most recent call last):
File "/tmp/tmptdk5s3s7/tmp3r1f56k_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s548648609 | p03993 | u102461423 | 1560812223 | Python | Python (3.4.3) | py | Runtime Error | 45 | 13880 | 155 | N = input()
A = [None] + [int(x) for x in input().split()]
answer = 0
for i in range(1,N+1):
if A[A[i]] == i:
answer += 1
answer //= 2
print(answer) | Traceback (most recent call last):
File "/tmp/tmplf4v04mi/tmp4nhn5cq9.py", line 1, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s937808996 | p03993 | u767664985 | 1559194636 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 122 | N = int(input())
*a, = map(int, input().split())
ans = 0
for i in range(N):
if i = a.index(a[i]):
ans += 1
print(ans)
| File "/tmp/tmpfdpjtbgd/tmput6d9pb9.py", line 6
if i = a.index(a[i]):
^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s831164946 | p03993 | u743272507 | 1554929781 | Python | Python (3.4.3) | py | Runtime Error | 58 | 13880 | 114 | n = int(input())
k = list(map(int,input().split()))
r = 0
for i in range(n):
if k[k[i]] == i: r += 1
print(r//2) | Traceback (most recent call last):
File "/tmp/tmp2_f1oyh3/tmpkep6yb57.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s612701598 | p03993 | u527261492 | 1554732386 | Python | Python (3.4.3) | py | Runtime Error | 60 | 14008 | 154 | n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
if a[a[i]]==i+1:
cnt+=1
break
else:
cnt=cnt
print(cnt)
| Traceback (most recent call last):
File "/tmp/tmptaz9foum/tmpniu86c15.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s189589092 | p03993 | u527261492 | 1554732351 | Python | Python (3.4.3) | py | Runtime Error | 20 | 2940 | 153 | n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
if a[a[i]]==i+1
cnt+=1
break
else:
cnt=cnt
print(cnt)
| File "/tmp/tmpa07g_lem/tmpx2ckb9z7.py", line 5
if a[a[i]]==i+1
^
SyntaxError: expected ':'
| |
s190854865 | p03993 | u256868077 | 1554687683 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 139 | n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
b=a[i]
if a[b] = i:
ans += 1
else:
i += 1
print(ans) | File "/tmp/tmp1e7tk32t/tmp_q_kcu99.py", line 6
if a[b] = i:
^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s872002287 | p03993 | u957722693 | 1554685899 | Python | Python (3.4.3) | py | Runtime Error | 55 | 13880 | 118 | n=int(input())
l=list(map(int,input().split()))
sum=0
for i in range(n):
if l[l[i]]==i:
sum+=1
print(int(sum/2)) | Traceback (most recent call last):
File "/tmp/tmpxnhe7q5s/tmpfyor3cvr.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s178456716 | p03993 | u227082700 | 1553914699 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | n=int(input());a=list(map(int,input().split()));ans=0
for i in range(n):
if i+1=a[a[i]-1]:ans+=1
print(ans) | File "/tmp/tmpky244xzg/tmpcgmewhq0.py", line 3
if i+1=a[a[i]-1]:ans+=1
^^^
SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
| |
s124236921 | p03993 | u118642796 | 1553573519 | Python | Python (3.4.3) | py | Runtime Error | 26 | 10612 | 124 | N = int(input())
A = [int[i] for i in input().split()]
ans = 0
for i in range(N):
if A[i] == i+1:
ans += 1
print(ans) | Traceback (most recent call last):
File "/tmp/tmpc8bfvrvp/tmp6s2y8e12.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s142662533 | p03993 | u557143627 | 1552747721 | Python | Python (3.4.3) | py | Runtime Error | 42 | 14008 | 194 | size = int(input())
rabbits = list(map(int, input().split()))
count = 0
for i in range(size):
if (rabbit[i] - 1) > i and (rabbits[rabbits[i]-1] -1) == i:
count += 1
print(count)
#123 | Traceback (most recent call last):
File "/tmp/tmprzovedvs/tmp3678sq9v.py", line 1, in <module>
size = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s465452844 | p03993 | u557143627 | 1552704955 | Python | Python (3.4.3) | py | Runtime Error | 40 | 13880 | 189 | size = int(input())
rabbits = list(map(int, input().split()))
count = 0
for i in range(size):
if (rabbit[i] - 1) > i and (rabbits[rabbits[i]-1] -1) == i:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmpdd6lhp41/tmpobd31vbh.py", line 1, in <module>
size = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s026427265 | p03993 | u557143627 | 1552704896 | Python | Python (2.7.6) | py | Runtime Error | 14 | 4480 | 189 | size = int(input())
rabbits = list(map(int, input().split()))
count = 0
for i in range(size):
if (rabbit[i] - 1) > i and (rabbits[rabbits[i]-1] -1) == i:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmpk09izam1/tmp1rnhlr3b.py", line 1, in <module>
size = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s040731321 | p03993 | u557143627 | 1552704829 | Python | Python (3.4.3) | py | Runtime Error | 40 | 14008 | 189 | size = int(input())
rabbits = list(map(int, input().split()))
count = 0
for i in range(size):
if (rabbit[i] - 1) > i and (rabbits[rabbits[i]-1] -1) == i:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmp7ylgar1n/tmpqdsjmyrn.py", line 1, in <module>
size = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s451356513 | p03993 | u552816314 | 1552351818 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 229 | size = int(raw_input())
rabbit_list = raw_input().split()
rabbits = [int(x) for x in rabbits_input]
count = 0
for i in range(size):
if (rabbits[i] - 1) > i and (rabbits[rabbits[i]-1] - 1) == i:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmp4w9icelu/tmp_5rdmtqt.py", line 1, in <module>
size = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s744826936 | p03993 | u552816314 | 1552351377 | Python | Python (3.4.3) | py | Runtime Error | 25 | 10420 | 221 | size = int(input())
rabbit_list = input().split()
rabbits = [int(x) for x in rabbits_input]
count = 0
for i in range(size):
if (rabbits[i] - 1) > i and (rabbits[rabbits[i]-1] - 1) == i:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmp498dc7_7/tmp9vkqoow0.py", line 1, in <module>
size = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s508939010 | p03993 | u367130284 | 1551721307 | Python | Python (3.4.3) | py | Runtime Error | 30 | 8756 | 100 | n=int(input());s=list(input());print(n-len(set(tuple(sorted((i+1,int(s[i*2]))))for i in range(n))))
| Traceback (most recent call last):
File "/tmp/tmp3kdy4c6b/tmp587hkscz.py", line 1, in <module>
n=int(input());s=list(input());print(n-len(set(tuple(sorted((i+1,int(s[i*2]))))for i in range(n))))
^^^^^^^
EOFError: EOF when reading a line
| |
s710339815 | p03993 | u740284863 | 1550299724 | Python | Python (3.4.3) | py | Runtime Error | 57 | 14008 | 129 | N = int(input())
n = list(map(int,input().split()))
ans = 0
for i in range(N):
if n[n[i]] == i:
ans += 1
print(ans) | Traceback (most recent call last):
File "/tmp/tmpqzxvj6gu/tmp96z9qm_q.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s958695188 | p03993 | u689562091 | 1549600724 | Python | Python (3.4.3) | py | Runtime Error | 66 | 14008 | 138 | N = int(input())
A = list(map(int, input().split()))
res = 0
for i in range(N):
if i + 1 == A[A[A[i]-1]]:
res += 1
print(res) | Traceback (most recent call last):
File "/tmp/tmpkbznyx9r/tmpbe0jcwi_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s802614452 | p03993 | u359856428 | 1548271276 | Python | Python (3.4.3) | py | Runtime Error | 21 | 4724 | 153 | n = int(input())
nums = [int(input()) - 1 for i in range(n)]
count = 0
for i in range(n):
if i == nums[nums[i]]:
count += 1
print(count // 2) | Traceback (most recent call last):
File "/tmp/tmpa198y_3f/tmpi2f4oj_n.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s172848143 | p03993 | u619819312 | 1547769709 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 131 | n=int(input(n))
a=list(map(int,input().split()))
c=0
for i in range(n):
if i==a[a[i]-1]:
c+=1
a[i]=n+1
print(c) | Traceback (most recent call last):
File "/tmp/tmp4y68f_bs/tmpt7hgpq81.py", line 1, in <module>
n=int(input(n))
^
NameError: name 'n' is not defined
| |
s167481135 | p03993 | u379702654 | 1537140956 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 472 | import qualified Data.IntMap as M
main :: IO ()
main = do
n <- readLn
as <- map read . words <$> getLine
print $ solve n as
solve :: Int -> [Int] -> Int
solve n as = go mp0
where
mp0 = M.fromList $ zip [1 .. n] as
go :: M.IntMap Int -> Int
go mp = case M.minViewWithKey mp of
Nothing -> 0
Just ((k, a), mp') | M.lookup a mp' == Just k -> 1 + go mp'
| otherwise -> go mp' | File "/tmp/tmpt7b6peoy/tmp02wdebqv.py", line 17
Just ((k, a), mp') | M.lookup a mp' == Just k -> 1 + go mp'
^
SyntaxError: unterminated string literal (detected at line 17)
| |
s668623883 | p03993 | u627417051 | 1531443213 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 130 | N = int(input())
a = list(map(int, input()split()))
c = 0
for i in range(N):
if a[a[i] - 1] == i + 1:
c += 1
print(int(c / 2)) | File "/tmp/tmpzn44hyfc/tmp7ttp98gh.py", line 2
a = list(map(int, input()split()))
^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
| |
s093796335 | p03993 | u143536664 | 1530575913 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 432 | for i in range(N):
for k in num_ban:
if k == i + 1:
ban = 1
break
if ban == 1:
ban = 0
continue
for j in A:
count_j += 1
if count_j != i + 1 and j == i + 1:
if A[i] == count_j:
count_ans += 1
num_ban.append(j)
num_ban.append(count_j)
else:
count_j = 0
else:
print(int(count_ans))
| Traceback (most recent call last):
File "/tmp/tmp6aw1zigg/tmplsgi6ufx.py", line 1, in <module>
for i in range(N):
^
NameError: name 'N' is not defined
| |
s029278198 | p03993 | u409064224 | 1530572890 | Python | Python (3.4.3) | py | Runtime Error | 62 | 14008 | 144 | n = int(input())
a = list(map(int,input().split()))
res = 0
for i in range(n):
sel = a[i]
if a[sel] == i:
res += 1
else:
print(res/2) | Traceback (most recent call last):
File "/tmp/tmpoy2g94au/tmpb7qd9lht.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s741262961 | p03993 | u409064224 | 1530572773 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 143 | n = int(input())
a = list(map(int,input().split()))
res = 0
for i in range(n):
sel = a[i]
if a[sel] = i:
res += 1
else:
print(res/2) | File "/tmp/tmp9b9p9oj5/tmpk16od7ts.py", line 7
if a[sel] = i:
^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s256899374 | p03993 | u941884460 | 1526046558 | Python | Python (3.4.3) | py | Runtime Error | 59 | 14008 | 156 | n = int(input())
nums = list(map(int,input().split()))
count = 0
for i in range(n):
if i < nums[i] and (i+1) == nums[nums[i]]:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmpghz51lv3/tmpl2be8har.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s135062464 | p03993 | u941884460 | 1526046507 | Python | Python (3.4.3) | py | Runtime Error | 41 | 13880 | 157 | n = int(input())
nums = list(map(int,input().split()))
count += 1
for i in range(n):
if i < nums[i] and (i+1) == nums[nums[i]]:
count += 1
print(count) | Traceback (most recent call last):
File "/tmp/tmphuqsj5o6/tmp4ljxsl9l.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s840061803 | p03993 | u729133443 | 1523250427 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | n = int(input())
a = map(int, input().split())
c = 0
for i in range(n):
if a[a[i]] == i:
c++
print(c) | File "/tmp/tmp0k6rudx0/tmprtwuff6i.py", line 6
c++
^
SyntaxError: invalid syntax
| |
s230718747 | p03993 | u258300459 | 1506208891 | Python | Python (3.4.3) | py | Runtime Error | 25 | 10420 | 332 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 19:10:57 2017
@author: taichiNakamura
"""
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# スペース区切りの整数の入力
a = map(int, input().split())
favorite = 0
for i,ai in enumerate(a):
if a[ai-1] == (i+1):
favorite += 1
print(favorite//2)
| Traceback (most recent call last):
File "/tmp/tmpdgcbjmzd/tmpqkj2e6qo.py", line 10, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s346743122 | p03993 | u343128979 | 1504205761 | Python | Python (3.4.3) | py | Runtime Error | 76 | 14008 | 242 | N = int(input())
usa = list(map(int, input().split()))
flag = [0 for x in range(N)]
count = 0
for i, j in enumerate(usa):
if(flag[i]):
continue
if(usa[j-1]-1 == i):
count+=1
flag[usa[j - 1]] = 1
print (count)
| Traceback (most recent call last):
File "/tmp/tmpw096ux5q/tmppumv6o7e.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s974775896 | p03993 | u619728370 | 1489841344 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 199 | number = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(number):
for j in range(number):
if a[i] ==j+1 and a[j] == i+1:
count += 1
print(int(count/2) | File "/tmp/tmp96eqfbqn/tmpr6mldbxr.py", line 8
print(int(count/2)
^
SyntaxError: '(' was never closed
| |
s226577540 | p03993 | u039623862 | 1482124409 | Python | Python (3.4.3) | py | Runtime Error | 55 | 14008 | 137 | n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(a):
if a[a[i]-1] -1 == i:
cnt +=1
print(cnt // 2) | Traceback (most recent call last):
File "/tmp/tmpl4mub_6n/tmpoenzgotw.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s788529689 | p03993 | u039623862 | 1482124381 | Python | Python (3.4.3) | py | Runtime Error | 58 | 14008 | 135 | n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(a):
if a[a[i]] -1 == i:
cnt +=1
print(cnt // 2) | Traceback (most recent call last):
File "/tmp/tmpn8i8nm1_/tmpk5mi2o2_.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s069976151 | p03993 | u998100201 | 1475308525 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 92 | n = input()
a = map(int,raw_input.split())
print sum(i == a[a[i-1]]-1 for i in range(n)) / 2 | File "/tmp/tmp6a2ndiix/tmpdgc2uh0r.py", line 3
print sum(i == a[a[i-1]]-1 for i in range(n)) / 2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s424419890 | p03993 | u464852639 | 1475254976 | Python | Python (3.4.3) | py | Runtime Error | 86 | 25068 | 172 | n = int(input())
a = map(int, input().split())
d = {i+1: j for (i,j) in enumerate(a)}
sum = 0
for x in range(n):
if( x == d[d[x]]):
sum += 1
print(sum//2) | Traceback (most recent call last):
File "/tmp/tmpm2j60gnh/tmp7cdkfsll.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s358142988 | p03993 | u464852639 | 1475254861 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3192 | 168 | n = int(input())
a = map(int, input().split())
d = {i+1: j for (i,j) in enumerate(a)}
sum = 0
for x in range(n):
if( x == d[d[x]]):
sum += 1
print sum//2 | File "/tmp/tmpezmyxhzq/tmpwpx4hoz7.py", line 11
print sum//2
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s424499998 | p03993 | u664481257 | 1475109483 | Python | Python (3.4.3) | py | Runtime Error | 111 | 14520 | 870 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :
"""
#
# Author: Noname
# URL: https://github.com/pettan0818
# License: MIT License
# Created: 2016-09-28
#
# Usage
#
"""
import sys
def input_single_line():
"""Receive Inputs."""
return input()
def input_two_line():
"""Receive Two Lined Inputs.
Like this.
N
1 2 3 4 5
"""
sys.stdin.readline()
target = sys.stdin.readline()
target = target.rstrip("\n")
target = target.split(" ")
return target
def search_lovers(target_list: list) -> None:
"""Search Simple."""
lovers = []
for i in target_list:
if target_list[i-1] == i-1:
lovers.append(i-1)
print(len(lovers))
if __name__ == "__main__":
import doctest
doctest.testmod()
target = input_two_line()
search_lovers(target)
| Traceback (most recent call last):
File "/tmp/tmp1_j5szz7/tmpyounncvg.py", line 53, in <module>
search_lovers(target)
File "/tmp/tmp1_j5szz7/tmpyounncvg.py", line 41, in search_lovers
if target_list[i-1] == i-1:
~^~
TypeError: unsupported operand type(s) for -: 'str' and 'int'
| |
s863781071 | p03993 | u875246225 | 1474949713 | Python | PyPy3 (2.4.0) | py | Runtime Error | 271 | 57260 | 204 | N = int(input())
a = list(map(int, input().split()))
b = {}
ans = 0
for i, v in enumerate(a):
if v > i+1:
b[i+1] = v
elif v < i+1:
if b[v] == i+1:
ans += 1
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp7yxekz12/tmpbxm7ry5v.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s895817059 | p03993 | u199479035 | 1474771271 | Python | Python (3.4.3) | py | Runtime Error | 86 | 10548 | 178 | n = input()
a = input()
a = a.split(sep=' ')
result = 0
for i in range(1,int(n)+1):
if int(a[int(a[i])]) == i:
result = result+1
result = int(result/2)
print(result) | Traceback (most recent call last):
File "/tmp/tmpryx6r4xp/tmp5nnymtpb.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s144679227 | p03993 | u199479035 | 1474771168 | Python | Python (3.4.3) | py | Runtime Error | 38 | 10548 | 168 | n = input()
a = input()
a = a.split(sep=' ')
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/tmpa3q7wzh1/tmpavlb5osy.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s677822291 | p03993 | u356172016 | 1474771108 | Python | PyPy2 (5.6.0) | py | Runtime Error | 39 | 10096 | 239 | rabbit_number = input()
rabbit_like = []
for i in range(rabbit_number):
like = raw_input()
rabbit_like.append(like)
couple = 0
for i in range(rabbit_number):
if rabbit_like[i] == rabbit_like[rabbit_like[i]-1]:
couple += 1
print couple | File "/tmp/tmpt6t4gzp1/tmpuwlpazxa.py", line 10
print couple
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s059539313 | p03993 | u356172016 | 1474771108 | Python | PyPy2 (5.6.0) | py | Runtime Error | 40 | 10096 | 239 | rabbit_number = input()
rabbit_like = []
for i in range(rabbit_number):
like = raw_input()
rabbit_like.append(like)
couple = 0
for i in range(rabbit_number):
if rabbit_like[i] == rabbit_like[rabbit_like[i]-1]:
couple += 1
print couple | File "/tmp/tmpaph8ek6a/tmpoy0af532.py", line 10
print couple
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s511347079 | p03993 | u199479035 | 1474770877 | Python | Python (3.4.3) | py | Runtime Error | 38 | 8756 | 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/tmpxfbxl2rq/tmpmhjyt24j.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s560023459 | p03993 | u199479035 | 1474770799 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 257 | n = input()
s = []
while len(s) < 2*n:
s = 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/tmpgfs4dl_w/tmpw_5nj9pr.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s920740414 | p03993 | u199479035 | 1474770616 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 263 | n = input()
l = 0
s = []
while len(s) < 2*n:
s = 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/tmpldufw0rr/tmpp14o5jjm.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s033943871 | p03993 | u199479035 | 1474770602 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 263 | n = input()
l = 0
s = []
while len(s) < 2*n:
s = 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/tmp2lreejlh/tmpa76l6udv.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s067781343 | p03993 | u199479035 | 1474770507 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 265 | n = input()
l = 0
s = []
while len(s) < 2*n-1:
s = 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/tmp_kpqs0zl/tmplrv774ca.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s434563167 | p03993 | u199479035 | 1474770217 | Python | Python (3.4.3) | py | Runtime Error | 42 | 8756 | 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/tmplbd2ksrq/tmp5o4r3c8w.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s106796494 | p03993 | u199479035 | 1474769770 | Python | Python (3.4.3) | py | Runtime Error | 38 | 8756 | 95 | n = int(input())
s = list(input())
r = 0
for i in range(0,n):
r = r+int(s[i])
print(r) | Traceback (most recent call last):
File "/tmp/tmpdw7q3au2/tmpz2icd2jc.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s291663991 | p03993 | u476127533 | 1474769743 | Python | Python (2.7.6) | py | Runtime Error | 84 | 11304 | 288 | 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 == int(a[(a[i])]) and a.index(a[(a[i])]) == (a[i]):
count +=1
a[i] = '0'
a[(a[i])] ='0'
print count
| File "/tmp/tmpuwo775mn/tmpkpmcbwfn.py", line 15
print count
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s641538272 | p03993 | u794929569 | 1474769082 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 148 | 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 f/2 | File "/tmp/tmpewqxenbu/tmpyoexwlv_.py", line 8
print f/2
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s665037075 | p03993 | u794929569 | 1474769002 | 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/tmp67538psx/tmpqn4tj2ni.py", line 8
print str(f/2)
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s654038414 | p03993 | u794929569 | 1474768926 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 148 | 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 f/2 | File "/tmp/tmpsh6p5x32/tmp5nss5eoc.py", line 8
print f/2
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s821482072 | p03993 | u794929569 | 1474768885 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 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/tmpbydy2yok/tmph3vu71f8.py", line 5
print s2
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s030277909 | p03993 | u794929569 | 1474768550 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 133 | s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
if s2[int(b)] == str(a):
f++
print f | File "/tmp/tmpguim1q7f/tmpwt1tju2a.py", line 7
f++
^
SyntaxError: invalid syntax
| |
s006411720 | p03993 | u794929569 | 1474768462 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 128 | s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
if s2[b] == str(a):
f++
print f | File "/tmp/tmpp61051dn/tmp84nvh7_i.py", line 7
f++
^
SyntaxError: invalid syntax
| |
s895728748 | p03993 | u102438343 | 1474767561 | Python | Python (2.7.6) | py | Runtime Error | 19 | 3332 | 301 | N = raw_input()
likes = raw_input()
pairs = 0
counter = 0
rabbit = 1
while counter < (int(N) * 2):
if int(likes[((int(likes[counter]) -1 ) * 2)]) == rabbit:
pairs += 1
rabbit += 1
counter += 2
else:
rabbit += 1
counter += 2
pairs = pairs / 2
print pairs | File "/tmp/tmphjhl0w5k/tmp7l04ory_.py", line 15
print pairs
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s760309879 | p03993 | u102438343 | 1474767561 | Python | Python (2.7.6) | py | Runtime Error | 19 | 3332 | 301 | N = raw_input()
likes = raw_input()
pairs = 0
counter = 0
rabbit = 1
while counter < (int(N) * 2):
if int(likes[((int(likes[counter]) -1 ) * 2)]) == rabbit:
pairs += 1
rabbit += 1
counter += 2
else:
rabbit += 1
counter += 2
pairs = pairs / 2
print pairs | File "/tmp/tmphjcpaw11/tmpqqssw6j1.py", line 15
print pairs
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s454298198 | p03993 | u199479035 | 1474766742 | Python | Python (3.4.3) | py | Runtime Error | 28 | 4916 | 194 | n = input()
a = {}
for i in range(1,int(n)+1):
a[i] = int(input())
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/tmpl9rze373/tmptnyclyhe.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s253730934 | p03993 | u436484848 | 1474766605 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 235 | num = int(input())
str = input()
Li = list(map(int,str.split(' ')))
CoupleNum = 0
for pointer in range(len(Li):
ai = Li[pointer]
if (ai > pointer+1):
if (Li[ai-1]=pointer+1):
CoupleNum++
print(CoupleNum) | File "/tmp/tmpotyppbp4/tmpffibp_60.py", line 5
for pointer in range(len(Li):
^
SyntaxError: invalid syntax
| |
s244785576 | p03993 | u199479035 | 1474766447 | Python | Python (3.4.3) | py | Runtime Error | 28 | 4788 | 194 | n = input()
a = {}
for i in range(1,int(n)+1):
a[i] = int(input())
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/tmptj39rejp/tmpoy_c6dt1.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s274423352 | p03993 | u199479035 | 1474766322 | Python | Python (3.4.3) | py | Runtime Error | 27 | 4788 | 194 | n = input()
a = {}
for i in range(1,int(n)+1):
a[i] = int(input())
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/tmp_n56l0bo/tmpsqujtjsc.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s989186278 | p03993 | u199479035 | 1474766226 | Python | Python (3.4.3) | py | Runtime Error | 28 | 4916 | 173 | n = input()
a = {}
for i in range(1,int(n)+1):
a[i] = int(input())
result = 0
for i in range(1,int(n)+1):
if a[a[i]] == i:
result = result+1
print(result/2) | Traceback (most recent call last):
File "/tmp/tmpkowdjmtx/tmp7eylguvn.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s898621528 | p03993 | u531436689 | 1474765746 | Python | Python (2.7.6) | py | Runtime Error | 29 | 8832 | 118 | N = input()
a = raw_input().split()
ans = 0
for i in xrange(N):
if a[ a[i] - 1 ] == i+1:
ans += 1
print ans | File "/tmp/tmpcxpw06in/tmpqqgw58sf.py", line 7
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s282892839 | p03993 | u575473686 | 1474765678 | Python | Python (3.4.3) | py | Runtime Error | 37 | 10548 | 160 | N = int(input())
A = map(int, input().split())
pairs = []
for i in range(len(A)):
if A[A[i] - 1] == i + 1:
pairs.append(1)
print(len(pairs) // 2) | Traceback (most recent call last):
File "/tmp/tmp28dadb1y/tmp2v8yhxfa.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s079539881 | p03993 | u575473686 | 1474765565 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 147 | N = int(input())
A = map(int, input().split())
pairs = []
for i in A:
if A[A[i] - 1] = i + 1:
pairs.append(1)
print(len(pairs) // 2) | File "/tmp/tmp7ot92jfj/tmp37zrxm52.py", line 7
if A[A[i] - 1] = i + 1:
^^^^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s366264011 | p03993 | u104282757 | 1474765466 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 134 | x_vec = map(int, raw_input().split())
ret = 0
for i in range(len(x_vec)):
if x_vec[x_vec[i]] == i:
ret += 1
print ret / 2 | File "/tmp/tmpmnlxlu9o/tmp94otw_9k.py", line 6
print ret / 2
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s376164040 | p03994 | u036104576 | 1601439046 | Python | Python (3.8.2) | py | Runtime Error | 68 | 10336 | 726 | import sys
import itertools
# import numpy as np
import time
import math
from heapq import heappop, heappush
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import permutations
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# map(int, input().split())
S = input()
K = int(input())
ans = []
for i, c in enumerate(S):
num = ord('z') - ord(c) + 1
if K >= num:
K -= num
ans.append('a')
else:
ans.append(c)
if K > 0:
ans[-1] = chr((ord(S[-1]) - ord('a') + K) % 26 + ord('a'))
print("".join(an))
| Traceback (most recent call last):
File "/tmp/tmp8g9t8djq/tmp_a94di7s.py", line 20, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s725339170 | p03994 | u761529120 | 1599912544 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 75520 | 315 | def main():
S = list(input())
K = int(input())
L = len(S)
for i in range(L):
if ord('z') - ord(S[i]) + 1 <= K:
K -= ord('z') - ord(S[i]) + 1
S[i] = 'a'
if K > 0:
S[-1] = chr(ord(S[-1]) + K)
print(''.join(S))
if __name__ == "__main__":
main() | Traceback (most recent call last):
File "/tmp/tmpkrr8q63q/tmpb_ueylcy.py", line 19, in <module>
main()
File "/tmp/tmpkrr8q63q/tmpb_ueylcy.py", line 2, in main
S = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s252274679 | p03994 | u721166818 | 1599710658 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9008 | 1889 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
// template.
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
return os << '(' << p.first << ", " << p.second << ')';
}
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
int n = 0;
for (auto e : vec) os << (n++ ? ", " : "{") << e;
return os << (n ? "}" : "{}");
}
template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
int n = 0;
for (auto e : st) os << (n++ ? ", " : "{") << e;
return os << (n ? "}" : "{}");
}
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
int n = 0;
for (auto e : mp) os << (n++ ? ", " : "{") << e;
return os << (n ? "}" : "{}");
}
template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
for (T& e : vec) is >> e;
return is;
}
#ifdef LOCAL
#define debug(...) \
std::cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
void debug_out() { std::cerr << '\n'; }
template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
std::cerr << head;
if (sizeof...(Tail) != 0) std::cerr << ", ";
debug_out(std::forward<Tail>(tail)...);
}
using namespace std;
using int64 = long long;
int main() {
string s;
int64 K;
cin >> s >> K;
int N = s.size();
for (int i = 0; i < N; i++) {
int idx = s[i] - 'a';
if (K >= 26 - idx) {
K -= 26 - idx;
s[i] = 'a';
}
}
if (K != 0) {
int tmp = s[N - 1] - 'a' + K;
s[N - 1] = tmp + 'a';
}
cout << s << endl;
return 0;
} | File "/tmp/tmp6h8awbh8/tmpkyuz3his.py", line 13
// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
^^
SyntaxError: invalid syntax
| |
s012291460 | p03994 | u289288647 | 1599011592 | Python | Python (3.8.2) | py | Runtime Error | 68 | 11240 | 209 | s = list(input())
k = int(input())
num = len(s)
for i in range(num):
a = 122-ord(s[i])+1
if a <= k:
k -= a
s[i] = 'a'
if k > 0:
s[-1] = chr(ord(s[-1])+k)
print(*s, sep='')
| Traceback (most recent call last):
File "/tmp/tmpykvqfldj/tmp_xxnjobw.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s333883243 | p03994 | u370721525 | 1598523952 | Python | Python (3.8.2) | py | Runtime Error | 1726 | 11192 | 417 | s = str(input())
K = int(input())
i = 0
for j in range(len(s)):
if s[j] != 'a':
if 26+ord('a')-ord(s[j]) <= K-i:
i += 26+ord('a')-ord(s[j])
s = s[:j] + 'a' + s[j+1:]
if i < K:
for k in range(1, len(s)+1):
if s[-k] != 'a':
if 26+ord('a')-ord(s[-k]) <= K-i:
s = s[:-k] + 'a' + s[-k+1:]
i += 26+ord('a')-ord(s[-k])
if i < K:
s = s[:-1] + chr(ord(s[-1])+K-i)
print(s) | Traceback (most recent call last):
File "/tmp/tmp4trryjak/tmplqlluygp.py", line 1, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s005542445 | p03994 | u062691227 | 1598309130 | Python | PyPy3 (7.3.0) | py | Runtime Error | 109 | 94332 | 310 | from string import ascii_lowercase
alp = ascii_lowercase
num = {char: i for i, char in enumerate(alp)}
s = input()
k = int(input())
ns = [num[char] for char in s]
for i in range(len(ns)):
v = ns[i]
if 26 - v <= k:
ns[i] = 0
k -= 26 - v
ns[-1] += k
print(''.join(alp[n] for n in ns)) | Traceback (most recent call last):
File "/tmp/tmpm7ucwkk7/tmpw7pchrw5.py", line 5, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s317420982 | p03994 | u252828980 | 1597752552 | Python | Python (3.8.2) | py | Runtime Error | 90 | 10228 | 294 | s = input()
k = int(input())
L = []
for i in range(len(s)):
L.append((ord("z")-ord(s[i])+1))
ans = ""
i = 0
while i < len(s):
if k-L[i] >= 0:
ans +="a"
k -=L[i]
i +=1
else:
ans +=s[i]
i +=1
ans = ans[:-1] + chr(ord(ans[-1]) + k)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpjyn6td22/tmpze0r42vc.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s918262999 | p03994 | u193264896 | 1597677955 | Python | Python (3.8.2) | py | Runtime Error | 48 | 9344 | 529 | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
S = input()
K = int(input())
ans = ''
for s in S:
if s=='a':
ans += s
else:
if 123 - ord(s) <= K:
ans += 'a'
K -= 123 - ord(s)
else:
ans += s
if K > 0:
ans = ans[:-1] + (chr(ord(ans[-1]) + K))
print(ans)
if __name__ == '__main__':
main()
| Traceback (most recent call last):
File "/tmp/tmpalsigqa9/tmpcidid45_.py", line 29, in <module>
main()
File "/tmp/tmpalsigqa9/tmpcidid45_.py", line 11, in main
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s498283071 | p03994 | u193264896 | 1597677877 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9444 | 455 | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
S = input()
K = int(input())
ans = ''
for s in S:
if 123 - ord(s) <= K:
ans += 'a'
K -= 123 - ord(s)
else:
ans += s
if K > 0:
ans = ans[:-1] + (chr(ord(ans[-1]) + K))
print(ans)
if __name__ == '__main__':
main()
| Traceback (most recent call last):
File "/tmp/tmpxl47o8h9/tmpm_mzer2n.py", line 26, in <module>
main()
File "/tmp/tmpxl47o8h9/tmpm_mzer2n.py", line 11, in main
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s353873222 | p03994 | u193264896 | 1597677676 | Python | Python (3.8.2) | py | Runtime Error | 52 | 9324 | 455 | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
S = input()
K = int(input())
ans = ''
for s in S:
if 123 - ord(s) <= K:
ans += 'a'
K -= 123 - ord(s)
else:
ans += s
if K > 0:
ans = ans[:-1] + (chr(ord(ans[-1]) + K))
print(ans)
if __name__ == '__main__':
main()
| Traceback (most recent call last):
File "/tmp/tmph0vl5a69/tmpd4x7r4ru.py", line 26, in <module>
main()
File "/tmp/tmph0vl5a69/tmpd4x7r4ru.py", line 11, in main
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s811898785 | p03994 | u562015767 | 1597184886 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 85772 | 558 | s = list(map(str,input()))
k = int(input())
ans = [0]*len(s)
for i in range(len(s)):
tmp = ord(s[i])
ans[i] = tmp
b = 123
for i in range(len(ans)):
tmp = ord(s[i])
if i != len(ans)-1:
if b - tmp <= k:
k = k-(b - tmp)
ans[i] = "a"
else:
ans[i] = s[i]
else:
if tmp + k >= 123:
tmp1 = tmp+k - 122
ans[i] = 96+tmp1
ans[i] = chr(ans[i])
else:
ans[i] += k
ans[i] = chr(ans[i])
print("".join(ans)) | Traceback (most recent call last):
File "/tmp/tmpe39rjuzk/tmpp5le05lk.py", line 1, in <module>
s = list(map(str,input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s100908185 | p03994 | u562015767 | 1597183813 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 85744 | 587 | s = list(map(str,input()))
k = int(input())
ans = [0]*len(s)
for i in range(len(s)):
tmp = ord(s[i])
ans[i] = tmp
a = 123
for i in range(len(ans)):
if i != len(ans)-1:
if a - ans[i] <= k:
k = k-(a - ans[i])
ans[i] = 97
ans[i] = chr(ans[i])
else:
ans[i] = chr(ans[i])
else:
if ans[i] + k >= 123:
tmp = ans[i]+k - 122
ans[i] = 96+tmp
ans[i] = chr(ans[i])
else:
ans[i] += k
ans[i] = chr(ans[i])
print("".join(ans)) | Traceback (most recent call last):
File "/tmp/tmp834gynz0/tmpeq5jvf92.py", line 1, in <module>
s = list(map(str,input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s775383018 | p03994 | u442877951 | 1596602053 | Python | Python (3.8.2) | py | Runtime Error | 1535 | 139460 | 312 | from bisect import *
S = list(str(input()))
K = int(input())
alp = list("abcdefghijklmnopqrstuvwxyz")
for i in range(len(S)):
b = bisect_left(alp,S[i])
print(b,K,S)
if i == len(S)-1:
S[i] = alp[(b+K)%26]
elif 26 - b <= K:
K -= (26 - b)
S[i] = "a"
if K == 0:
break
print("".join(S)) | Traceback (most recent call last):
File "/tmp/tmpykrrvutn/tmpslmod_11.py", line 2, in <module>
S = list(str(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s493418513 | p03994 | u373047809 | 1596251560 | Python | Python (3.8.2) | py | Runtime Error | 60 | 9976 | 132 | s,k,t=input(),int(input()),""
for q in s:
if(p:=(123-ord(q))%26)<=k:t+="a";k-=p
else:t+=q
*a,b=t
print(a+chr((ord(b)-97+k)%26+97)) | Traceback (most recent call last):
File "/tmp/tmp0bsu3jvk/tmpc3kfi76l.py", line 1, in <module>
s,k,t=input(),int(input()),""
^^^^^^^
EOFError: EOF when reading a line
| |
s727725937 | p03994 | u373047809 | 1596251441 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9236 | 134 | s,k,t=input(),int(input()),""
for q in s:
if(p:=(123-ord(q))%26)<=k:n+="a";K-=i
else:n+=c
print(t[:-1]+chr((ord(t[-1])-97+k)%26+97)) | Traceback (most recent call last):
File "/tmp/tmp2a8al7tg/tmp58awl7qg.py", line 1, in <module>
s,k,t=input(),int(input()),""
^^^^^^^
EOFError: EOF when reading a line
| |
s869090466 | p03994 | u519968172 | 1595612545 | Python | Python (3.8.2) | py | Runtime Error | 62 | 10064 | 160 | s=input()
k=int(input())
l=list(s)
for i in range(len(s)):
f=-ord(s[i])+ord("z")+1
if f<=k:
l[i]="a"
k-=f
l[-1]=chr(ord(l[-1])+k)
print("".join(l)) | Traceback (most recent call last):
File "/tmp/tmpl53hok11/tmp2olf8wsp.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s048034811 | p03994 | u519968172 | 1595612193 | Python | Python (3.8.2) | py | Runtime Error | 63 | 10244 | 160 | s=input()
k=int(input())
l=list(s)
for i in range(len(s)):
f=-ord(s[i])+ord("z")+1
if f<=k:
l[i]="a"
k-=f
l[-1]=chr(ord(s[-1])+k)
print("".join(l)) | Traceback (most recent call last):
File "/tmp/tmp9m6qvloq/tmpiv0ywog9.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s053859848 | p03994 | u339199690 | 1594975633 | Python | Python (3.8.2) | py | Runtime Error | 71 | 9920 | 254 | S = list(input())
K = int(input())
l = 0
for i, s in enumerate(S):
if ord('z') - ord(s) + 1 <= K:
S[i] = 'a'
K -= ord('z') - ord(s) + 1
else:
l = i
else:
if K > 0:
S[l] = chr(ord(S[l]) + K)
print("".join(S))
| Traceback (most recent call last):
File "/tmp/tmpgs0dz9o3/tmpq6de0kji.py", line 1, in <module>
S = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s290097123 | p03994 | u339199690 | 1594975538 | Python | Python (3.8.2) | py | Runtime Error | 70 | 10016 | 226 | S = list(input())
K = int(input())
for i, s in enumerate(S):
if ord('z') - ord(s) + 1 <= K:
S[i] = 'a'
K -= ord('z') - ord(s) + 1
else:
if K > 0:
S[-1] = chr(ord(S[-1]) + K)
print("".join(S))
| Traceback (most recent call last):
File "/tmp/tmpgtdgytdz/tmpubbdkp2x.py", line 1, in <module>
S = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s090397077 | p03994 | u222668979 | 1593832507 | Python | Python (3.8.2) | py | Runtime Error | 80 | 11616 | 368 | from math import ceil
s, k = input(), int(input())
ans = []
a = ord('z') + 1
for i in s:
if k == 0:
ans.append(ord(i))
elif a - ord(i) <= k and i != 'a':
k -= a - ord(i)
ans.append(ord('a'))
else:
ans.append(ord(i))
ans[-1] += k
if ans[-1] >= a:
ans[-1] -= ceil((ans[-1] - (a - 1)) / 26)
print(*map(chr, ans), sep='')
| Traceback (most recent call last):
File "/tmp/tmpia93eyhv/tmpv000lxsb.py", line 3, in <module>
s, k = input(), int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s365847434 | p03994 | u222668979 | 1593832460 | Python | Python (3.8.2) | py | Runtime Error | 76 | 11848 | 355 | from math import ceil
s, k = input(), int(input())
ans = []
a = ord('z') + 1
for i in s:
if k == 0:
ans.append(ord(i))
elif a - ord(i) <= k:
k -= a - ord(i)
ans.append(ord('a'))
else:
ans.append(ord(i))
ans[-1] += k
if ans[-1] >= a:
ans[-1] -= ceil((ans[-1] - (a - 1)) / 26)
print(*map(chr, ans), sep='')
| Traceback (most recent call last):
File "/tmp/tmp7l45g78l/tmpdcanw9b4.py", line 3, in <module>
s, k = input(), int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s199574143 | p03994 | u222668979 | 1593832300 | Python | Python (3.8.2) | py | Runtime Error | 82 | 11576 | 324 | from math import ceil
s, k = input(), int(input())
ans = []
a = ord('z') + 1
for i in s:
if a - ord(i) <= k and i != 'a':
k -= a - ord(i)
ans.append(ord('a'))
else:
ans.append(ord(i))
ans[-1] += k
if ans[-1] >= a:
ans[-1] -= ceil((ans[-1] - (a - 1)) / 26)
print(*map(chr, ans), sep='')
| Traceback (most recent call last):
File "/tmp/tmphkteujr8/tmp98eqbbl7.py", line 3, in <module>
s, k = input(), int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s493305615 | p03994 | u222668979 | 1593832265 | Python | PyPy3 (7.3.0) | py | Runtime Error | 132 | 83996 | 324 | from math import ceil
s, k = input(), int(input())
ans = []
a = ord('z') + 1
for i in s:
if a - ord(i) <= k and i != 'a':
k -= a - ord(i)
ans.append(ord('a'))
else:
ans.append(ord(i))
ans[-1] += k
if ans[-1] >= a:
ans[-1] -= ceil((ans[-1] - (a - 1)) / 26)
print(*map(chr, ans), sep='')
| Traceback (most recent call last):
File "/tmp/tmpuslr2peb/tmpwd_zl2gg.py", line 3, in <module>
s, k = input(), int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s932697822 | p03994 | u222668979 | 1593832052 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 85828 | 342 | from math import ceil
s, k = input(), int(input())
ans = []
a = ord('z') + 1
for i in s:
if k == 0:
break
elif a - ord(i) <= k:
k -= a - ord(i)
ans.append(ord('a'))
else:
ans.append(ord(i))
ans[-1] += k
if ans[-1] >= a:
ans[-1] -= ceil((ans[-1] - (a - 1)) / 26)
print(*map(chr, ans), sep='')
| Traceback (most recent call last):
File "/tmp/tmp2o38d7og/tmpfjufx37b.py", line 3, in <module>
s, k = input(), int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s742490244 | p03994 | u597455618 | 1592589785 | Python | Python (3.8.2) | py | Runtime Error | 61 | 10036 | 225 | s = list(input())
k = int(input())
n = len(s)
c = ord("z") + 1
i = 0
for i in range(n):
tmp = c - ord(s[i])
if k >= tmp:
s[i] = "a"
k -= tmp
if k > 0:
s[n-1] = chr(ord(s[n-1])+k)
print("".join(s))
| Traceback (most recent call last):
File "/tmp/tmpfrx3ph2s/tmpzhuh2tf1.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s210024147 | p03994 | u597455618 | 1592589680 | Python | Python (3.8.2) | py | Runtime Error | 57 | 9908 | 231 | s = list(input())
k = int(input())
n = len(s)
c = ord("z") + 1
i = 0
for i in range(n):
tmp = c - ord(s[i])
if k > 0 and k >= tmp:
s[i] = "a"
k -= tmp
else:
s[n-1] = chr(ord(s[n-1])+k)
print("".join(s))
| Traceback (most recent call last):
File "/tmp/tmpxg9rxarf/tmpseqeu2lm.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s266044332 | p03994 | u597455618 | 1592589399 | Python | Python (3.8.2) | py | Runtime Error | 57 | 10056 | 221 | s = list(input())
k = int(input())
n = len(s)
c = ord("z") + 1
i = 0
for i in range(n):
tmp = c - ord(s[i])
if k >= tmp:
s[i] = "a"
k -= tmp
else:
s[n-1] = chr(ord(s[n-1])+k)
print("".join(s))
| Traceback (most recent call last):
File "/tmp/tmpjb68o5i9/tmp18vxhgjy.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s793094351 | p03994 | u597455618 | 1592589238 | Python | Python (3.8.2) | py | Runtime Error | 1715 | 9356 | 226 | s = input()
k = int(input())
n = len(s)
c = ord("z") + 1
i = 0
for i in range(n):
tmp = c - ord(s[i])
if k >= tmp:
s = s[:i] + "a" + s[i+1:]
k -= tmp
else:
s = s[:n-1] + chr(ord(s[n-1])+k)
print(s)
| Traceback (most recent call last):
File "/tmp/tmpqcln3k_q/tmp6pvu3wu_.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s280108692 | p03994 | u597455618 | 1592588602 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9188 | 855 | a = input().replace("S", " S").replace("H", " H").replace("D", " D").replace("C", " C").split()
m, s, h, d, c = [], [], [], [], []
ans = []
for i in range(len(a)):
if a[i][1] in ["2", "3", "4", "5", "6", "7", "8", "9"]:
m.append(i)
else:
if a[i][0] == "S":
s.append(i)
if len(s) == 5:
ans = s
break
elif a[i][0] == "H":
h.append(i)
if len(h) == 5:
ans = h
break
elif a[i][0] == "D":
d.append(i)
if len(d) == 5:
ans = d
break
else:
c.append(i)
if len(c) == 5:
ans = c
break
ch = 0
d = ""
for i in ans:
d += "".join(a[ch:i])
ch = i+1
if d == "":
print(0)
else:
print(d) | Traceback (most recent call last):
File "/tmp/tmpmcfl953t/tmpka2emkhr.py", line 1, in <module>
a = input().replace("S", " S").replace("H", " H").replace("D", " D").replace("C", " C").split()
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.