Submission #2739618
Source Code Expand
# -*- coding: utf-8 -*- if __name__ == '__main__': n = int(input()) a = list(map(lambda x: int(x) - 1, input().split())) count = 0 # See: # http://code-festival-2016-quala.contest.atcoder.jp/data/other/code-festival-2016-quala/editorial.pdf for i in range(len(a)): if i == a[a[i]]: count += 1 print(count // 2)
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | hiro_hiro |
Language | Python (3.4.3) |
Score | 200 |
Code Size | 378 Byte |
Status | AC |
Exec Time | 77 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 | 2940 KB |
0_01.txt | AC | 17 ms | 2940 KB |
0_02.txt | AC | 17 ms | 2940 KB |
1_00.txt | AC | 17 ms | 2940 KB |
1_01.txt | AC | 77 ms | 13880 KB |
1_02.txt | AC | 67 ms | 13812 KB |
1_03.txt | AC | 68 ms | 13812 KB |
1_04.txt | AC | 70 ms | 13880 KB |
1_05.txt | AC | 68 ms | 14008 KB |
1_06.txt | AC | 67 ms | 13880 KB |
1_07.txt | AC | 69 ms | 13812 KB |
1_08.txt | AC | 36 ms | 7148 KB |
1_09.txt | AC | 58 ms | 12008 KB |
1_10.txt | AC | 53 ms | 10596 KB |
1_11.txt | AC | 25 ms | 4652 KB |