#include "game.h"
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <set>
#include <queue>
#include <algorithm>
#include <limits.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef map<int, int> mii;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vpl;
#define mod 1000000007
#define inf 10000000000000
#define F first
#define S second
#define nd '\n'
#define forn(i, x, n) for (ll i = x; i < ll(n); i++)
#define fornl(i, x, n) for(ll i = x; i >= ll(n); i--)
#define cina(x) for(auto &c : x) cin >> c;
#define cingra(x, y, n) forn(i, y, n){ll a, b; cin >> a >> b; a--; b--; x[a].pb(b); x[b].pb(a);}
#define cingraw(x, y, n) forn(i, y, n){ll a, b, c; cin >> a >> b >> c; a--; b--; x[a].pb({b, c}); x[b].pb({a, c});}
#define fnd(x, y) find(x.begin(), x.end(), y)
#define srt(x) sort(x.begin(), x.end())
#define debug(x) cout << #x << " = " << x << nd;
#define debugv(x, s) cout << #x << " = "; forn(i, 0, s) cout << x[i] << " "; cout << nd;
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define freop(in, out) freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);
#define rmod(a, b) (a % mod - b % mod + mod) % mod
#define smod(a, b) (a % mod + b % mod) % mod
#define mmod(a, b) (a % mod) * (b % mod) % mod
#define yes cout << "YES" << nd
#define no cout << "NO" << nd
#define pb push_back
#define all(x) x.begin(), x.end()
/*struct dsu{
vl p;
dsu(ll n){forn(i, 0, n) p.pb(i);}
ll find(ll x){
if(p[x] == x) return x;
return p[x] = find(p[x]);
}
bool onion(ll x, ll y){
x = find(x); y = find(y);
if(x == y) return true;
p[y] = x; return false;
}
};*/
map<ll, ll> freq; ll q = 0, r, ng;
void initialize(int n) {
ng = n; r = (n * (n - 1)) / 2;
}
int hasEdge(int u, int v) {
freq[u]++; freq[v]++;
if(freq[u] == ng - 1 || freq[v] == ng - 1 || q == r - (ng - 1)) return 1;
else{ q++; return 0;}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |