Submission #891297
Source Code Expand
import std.stdio; import std.conv, std.array, std.algorithm, std.string; import std.math, std.random, std.range, std.datetime; import std.bigint; void main(){ int n = readln.chomp.to!int; int[] as = readln.chomp.split.map!(to!int).map!(x => x - 1).array; int count = 0; foreach(i, a; as){ if(i < a && as[a] == i) count ++; } count.writeln; }
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | iica |
Language | D (DMD64 v2.070.1) |
Score | 200 |
Code Size | 377 Byte |
Status | AC |
Exec Time | 21 ms |
Memory | 3004 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 | 2 ms | 256 KB |
0_01.txt | AC | 3 ms | 256 KB |
0_02.txt | AC | 2 ms | 256 KB |
1_00.txt | AC | 3 ms | 256 KB |
1_01.txt | AC | 21 ms | 3004 KB |
1_02.txt | AC | 21 ms | 3004 KB |
1_03.txt | AC | 21 ms | 3004 KB |
1_04.txt | AC | 21 ms | 3004 KB |
1_05.txt | AC | 21 ms | 3004 KB |
1_06.txt | AC | 21 ms | 3004 KB |
1_07.txt | AC | 21 ms | 3004 KB |
1_08.txt | AC | 9 ms | 1404 KB |
1_09.txt | AC | 18 ms | 2468 KB |
1_10.txt | AC | 15 ms | 2156 KB |
1_11.txt | AC | 5 ms | 764 KB |