Submission #1128918

#TimeUsernameProblemLanguageResultExecution timeMemory
1128918djs100201Game (IOI14_game)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h> #include "game.h" #define all(v) v.begin(), v.end() using namespace std; using ll = long long; const ll n_ = 3e5 + 100; ll checked[n_], x, y; void initialize(int n) { } int hasEdge(int u, int v) { if (checked[u] && checked[v]) { return checked[u] = checked[v] ? 1 : 0; } else if (checked[u]) { if (x <= y) checked[v] = 1; else checked[v] = 2; return checked[u] = checked[v] ? 1 : 0; } else if (checked[v]) { if (x <= y) checked[u] = 1; else checked[u] = 2; return checked[u] = checked[v] ? 1 : 0; } else { if (x < y) { checked[u] = checked[v] = 1; x += 2; return 1; } else if (y > x) { checked[u] = checked[v] = 2; y += 2; return 1; } else { checked[u] = 1, checked[v] = 2; x++, y++; return 0; } } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...