#include "game.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
unordered_map<int, int> sections;
void initialize(int n) {
for (int i=0;i<n;i++) {
for (int j=0;j<n;j++) {
if (i <= j) continue;
int bruh;
for (bruh=11;bruh>-1;bruh--) if (((i >> bruh) & 1) != ((j >> bruh) & 1)) break;
int sus = (i >> (bruh + 1)) + bruh * 10000000;
//cout << i << ' ' << j << ' ' << bruh << ' ' << sus << endl;
if (sections.find(sus) == sections.end()) sections[sus] = 0;
else sections[sus] += 1;
}
}
}
int hasEdge(int u, int v) {
int bruh; for (bruh = 11;bruh>-1;bruh--) if (((u >> bruh) & 1) != ((v >> bruh) & 1)) break;
int sus = (u >> (bruh + 1)) + bruh * 10000000;
if (sections[sus] == 0) return 1;
else sections[sus] -= 1; 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... |