# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
959692 |
2024-04-08T19:58:31 Z |
vjudge1 |
Game (IOI14_game) |
C++17 |
|
1 ms |
348 KB |
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1500;
int deg[N], cnt[N];
void initialize(int n) {
memset(cnt, 0, sizeof(cnt));
for (int i = 0; i < n; i++) {
deg[i] = n;
}
}
int hasEdge(int u, int v) {
deg[u]--;
deg[v]--;
cnt[deg[u]]++;
cnt[deg[v]]++;
if (cnt[deg[u]] >= deg[u]) {
cnt[deg[u]]--;
cnt[deg[v]]--;
deg[u]++;
deg[v]++;
return 1;
}
if (cnt[deg[v]] >= deg[v]) {
cnt[deg[u]]--;
cnt[deg[v]]--;
deg[u]++;
deg[v]++;
return 1;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |