Submission #5438299
Source Code Expand
local n = io.read("*n") local a = {} for i = 1, n do a[i] = io.read("*n") end local cnt = 0 for i = 1, n - 1 do if(i < a[i] and a[a[i]] == i) then cnt = cnt + 1 end end print(cnt)
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | obakyan |
Language | Lua (5.3.2) |
Score | 200 |
Code Size | 198 Byte |
Status | AC |
Exec Time | 33 ms |
Memory | 2424 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 | 7 ms | 752 KB |
0_01.txt | AC | 1 ms | 256 KB |
0_02.txt | AC | 1 ms | 256 KB |
1_00.txt | AC | 1 ms | 256 KB |
1_01.txt | AC | 31 ms | 2424 KB |
1_02.txt | AC | 29 ms | 2424 KB |
1_03.txt | AC | 33 ms | 2424 KB |
1_04.txt | AC | 33 ms | 2424 KB |
1_05.txt | AC | 33 ms | 2424 KB |
1_06.txt | AC | 33 ms | 2424 KB |
1_07.txt | AC | 29 ms | 2424 KB |
1_08.txt | AC | 12 ms | 1400 KB |
1_09.txt | AC | 26 ms | 2424 KB |
1_10.txt | AC | 21 ms | 2424 KB |
1_11.txt | AC | 6 ms | 888 KB |