Submission #405399

#TimeUsernameProblemLanguageResultExecution timeMemory
405399rocks03Game (IOI14_game)C++14
0 / 100
1 ms320 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() #define debug(x) cout << #x << ": " << x << " " #define nl cout << "\n" #define rep(i, a, b) for(int i = (a); i <= (b); i++) #define per(i, a, b) for(int i = (a); i >= (b); i--) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int MAXN = 1e3+100; int N, cnt[MAXN]; void initialize(int n){ N = n; fill(cnt, cnt + N, N - 1); } int deg1 = 0; int hasEdge(int u, int v){ cnt[u]--, cnt[v]--; if(cnt[u] == 1) deg1++; if(cnt[v] == 1) deg1++; if(cnt[u] == 0 || cnt[v] == 0) return 1; if(cnt[u] == 1 && cnt[v] == 1) return 1; if(deg1 > 2 && (cnt[u] == 1 || cnt[v] == 1)) return 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...