Submission #890764
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace b { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); int ans = 0; for (int i = 0; i < n; i++) { if (a[a[i]] == i) ans++; } Console.WriteLine(ans/2); } } }
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | yu3mars |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 547 Byte |
Status | WA |
Exec Time | 64 ms |
Memory | 10968 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | RE | 27 ms | 2912 KB |
0_01.txt | RE | 24 ms | 2528 KB |
0_02.txt | RE | 24 ms | 2528 KB |
1_00.txt | RE | 24 ms | 2528 KB |
1_01.txt | RE | 64 ms | 10720 KB |
1_02.txt | RE | 64 ms | 10720 KB |
1_03.txt | RE | 64 ms | 10720 KB |
1_04.txt | RE | 63 ms | 10720 KB |
1_05.txt | WA | 63 ms | 10968 KB |
1_06.txt | RE | 64 ms | 10720 KB |
1_07.txt | RE | 64 ms | 10720 KB |
1_08.txt | RE | 40 ms | 6496 KB |
1_09.txt | WA | 56 ms | 9688 KB |
1_10.txt | RE | 53 ms | 8544 KB |
1_11.txt | WA | 29 ms | 4568 KB |