제출 #1019868

#제출 시각아이디문제언어결과실행 시간메모리
1019868onbert게임 (IOI14_game)C++17
15 / 100
2 ms856 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int maxn = 1505; int n; vector<vector<bool>> adj(maxn, vector<bool>(maxn, 0)); map<vector<bool>, int> mp; vector<int> cnt(maxn, 0); void initialize(int N) { n = N; adj.resize(n); for (int i=0;i<n;i++) { adj[i].resize(n); } cnt.resize(n); } int hasEdge(int u, int v) { adj[u][v] = adj[v][u] = 1; mp[adj[u]]++, mp[adj[v]]++; cnt[u]++, cnt[v]++; // cout << mp[adj[u]] << " " << mp[adj[v]] << endl; // cout << cnt[u] << " " << cnt[v] << endl; if (n-mp[adj[u]] == cnt[u] || n-mp[adj[v]] == cnt[v]) { mp[adj[u]]--, mp[adj[v]]--; adj[u][v] = adj[v][u] = 0; cnt[u]--, cnt[v]--; return true; } return false; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...