Submission #891665
Source Code Expand
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define debug(x) cout << "debug " << x << endl; #define INF (1 << 29) using namespace std; int main(){ int n, cnt = 0; map<int, int> mi; cin >> n; rep(i,n){ int a = i + 1, b; cin >> b; if(a > b) swap(a, b); if(mi[a] == b) cnt++; mi[a] = b; } cout << cnt << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | noy72 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 511 Byte |
Status | WA |
Exec Time | 64 ms |
Memory | 3328 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 | AC | 3 ms | 256 KB |
0_01.txt | AC | 3 ms | 256 KB |
0_02.txt | AC | 3 ms | 384 KB |
1_00.txt | AC | 3 ms | 256 KB |
1_01.txt | AC | 64 ms | 2560 KB |
1_02.txt | AC | 57 ms | 3328 KB |
1_03.txt | WA | 56 ms | 3200 KB |
1_04.txt | WA | 56 ms | 3200 KB |
1_05.txt | WA | 58 ms | 3200 KB |
1_06.txt | WA | 55 ms | 3200 KB |
1_07.txt | AC | 56 ms | 3200 KB |
1_08.txt | AC | 21 ms | 1408 KB |
1_09.txt | AC | 46 ms | 2688 KB |
1_10.txt | AC | 39 ms | 2304 KB |
1_11.txt | AC | 10 ms | 768 KB |