Submission #891318


Source Code Expand

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>

using namespace std;

int main(void){
	int n; cin >> n;
	vector <vector <int> > v(n, vector <int>(n));
	for(int i=0; i<n; i++){
		int t; cin >> t;
		v[i][t]=1;
	}
	int res=0;
	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			if(v[i][j]==1 && v[j][i]==1){
				res++;
			}
		}
	}
	cout << res << endl;
	return 0;
}

Submission Info

Submission Time
Task B - Friendly Rabbits
User chiwakii
Language C++14 (GCC 5.4.1)
Score 0
Code Size 454 Byte
Status WA
Exec Time 2223 ms
Memory 1079936 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 2
WA × 1
AC × 3
WA × 1
TLE × 10
MLE × 1
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 2 ms 256 KB
0_02.txt WA 3 ms 256 KB
1_00.txt AC 3 ms 256 KB
1_01.txt TLE 2221 ms -1861760 KB
1_02.txt TLE 2221 ms -1853824 KB
1_03.txt TLE 2222 ms -1844224 KB
1_04.txt TLE 2221 ms -1860352 KB
1_05.txt TLE 2222 ms -1850624 KB
1_06.txt TLE 2221 ms -1864576 KB
1_07.txt TLE 2222 ms -1857664 KB
1_08.txt TLE 2223 ms -1889152 KB
1_09.txt TLE 2221 ms -1872256 KB
1_10.txt TLE 2222 ms -1860608 KB
1_11.txt MLE 1392 ms 1079936 KB