Submission #900069
Source Code Expand
N = input()
l = raw_input()
a = map(int, l.split(" "))
count = 0
for i in range(N):
#print(i, a[i])
if a[a[i]-1] -1 == i:
count = count + 1
print(count/2)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Friendly Rabbits |
| User | iazekr |
| Language | Python (2.7.6) |
| Score | 200 |
| Code Size | 166 Byte |
| Status | AC |
| Exec Time | 85 ms |
| Memory | 11904 KiB |
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 | 16 ms | 2568 KiB |
| 0_01.txt | AC | 16 ms | 2568 KiB |
| 0_02.txt | AC | 16 ms | 2568 KiB |
| 1_00.txt | AC | 16 ms | 2568 KiB |
| 1_01.txt | AC | 85 ms | 11904 KiB |
| 1_02.txt | AC | 79 ms | 11904 KiB |
| 1_03.txt | AC | 83 ms | 11904 KiB |
| 1_04.txt | AC | 81 ms | 11776 KiB |
| 1_05.txt | AC | 79 ms | 11904 KiB |
| 1_06.txt | AC | 79 ms | 11904 KiB |
| 1_07.txt | AC | 81 ms | 11904 KiB |
| 1_08.txt | AC | 39 ms | 6016 KiB |
| 1_09.txt | AC | 68 ms | 10240 KiB |
| 1_10.txt | AC | 59 ms | 8960 KiB |
| 1_11.txt | AC | 26 ms | 4100 KiB |