# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
864331 |
2023-10-22T14:18:19 Z |
maks007 |
Paths (BOI18_paths) |
C++14 |
|
101 ms |
3384 KB |
#include "bits/stdc++.h"
using namespace std;
vector <int> color;
vector <vector <int>> cntColor;
signed main () {
int n, m, k;
cin >> n >> m >> k;
color.resize(n);
cntColor.resize(n, vector <int> (k + 1, 0));
for(int i = 0; i < n; i ++) cin >> color[i];
for(int i = 0, u, v; i < m; i ++) {
cin >> u >> v;
u --, v --;
cntColor[u][color[v]] ++;
cntColor[v][color[u]] ++;
}
int ans = 0;
for(int color2 = 1; color2 <= k; color2 ++) {
for(int i = 0; i < n; i ++) {
if(color[i] == color2) {
for(int color1 = 1; color1 <= k; color1 ++) {
ans += cntColor[i][color1];
if(k == 2) continue;
for(int color3 = color1 + 1; color3 <= k; color3 ++) {
ans += 2 * (cntColor[i][color1] * cntColor[i][color3]);
}
}
}
}
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
101 ms |
3384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
28 ms |
956 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |