Submission #1676543
Source Code Expand
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): N = int(input()) A = tuple(map(int, input().split())) A = tuple(a-1 for a in A) # 0-based ans = 0 for i in range(N): b = A[i] if A[b] == i: ans += 1 ans //= 2 print(ans) if __name__ == "__main__": main()
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | yumsiim |
Language | Python (3.4.3) |
Score | 200 |
Code Size | 325 Byte |
Status | AC |
Exec Time | 61 ms |
Memory | 14008 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 17 ms | 3064 KB |
0_01.txt | AC | 17 ms | 2940 KB |
0_02.txt | AC | 17 ms | 3060 KB |
1_00.txt | AC | 17 ms | 2940 KB |
1_01.txt | AC | 61 ms | 14008 KB |
1_02.txt | AC | 57 ms | 13940 KB |
1_03.txt | AC | 58 ms | 13940 KB |
1_04.txt | AC | 57 ms | 13940 KB |
1_05.txt | AC | 57 ms | 14008 KB |
1_06.txt | AC | 57 ms | 13940 KB |
1_07.txt | AC | 58 ms | 13940 KB |
1_08.txt | AC | 31 ms | 6764 KB |
1_09.txt | AC | 51 ms | 12444 KB |
1_10.txt | AC | 45 ms | 10184 KB |
1_11.txt | AC | 23 ms | 4780 KB |