Problem p03993 (python)

Fixed submission:
n = input()
a = input()
a = a.split(sep=' ')

result = 0
for i in range(1,int(n)+1):
    if int(a[int(a[i-1])-1]) == i:
        result = result+1
result = int(result/2)
print(result)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
r = 0
for i in range(0,n):
    r = r+int(s[i])
    
print(r)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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)