Submission #891796
Source Code Expand
#include <vector> #include <iostream> int main() { std::vector<std::vector<int>> nakayosimap; int n; std::cin >> n; nakayosimap.resize(n); for (int i = 0; i < n; i++) { nakayosimap.at(i).assign(n, 0); } for (int i = 0; i < n; i++) { int suki; std::cin >> suki; nakayosimap.at(i).at(suki - 1) = 1; } int count = 0; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { if (nakayosimap.at(i).at(j) == 1 && nakayosimap.at(j).at(i) == 1) { count++; } } } std::cout << count << std::endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Friendly Rabbits |
User | theoldmoon0602 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 564 Byte |
Status | MLE |
Exec Time | 2215 ms |
Memory | 1079936 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 | 256 KB |
1_00.txt | AC | 3 ms | 256 KB |
1_01.txt | TLE | 2213 ms | -2013824 KB |
1_02.txt | TLE | 2215 ms | -1987712 KB |
1_03.txt | TLE | 2214 ms | -1983744 KB |
1_04.txt | TLE | 2214 ms | -2009216 KB |
1_05.txt | TLE | 2214 ms | -2003968 KB |
1_06.txt | TLE | 2213 ms | -2009600 KB |
1_07.txt | TLE | 2214 ms | -1995776 KB |
1_08.txt | TLE | 2214 ms | -2032256 KB |
1_09.txt | TLE | 2214 ms | -2001152 KB |
1_10.txt | TLE | 2214 ms | -2008192 KB |
1_11.txt | MLE | 1409 ms | 1079936 KB |