Submission #226030

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2260302020-04-22 11:05:518e7Game (IOI14_game)C++14
15 / 100
6 ms384 KiB
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
using namespace std;
bitset<1505> bits[1505];
int cnt[1505] = {};
set<int> block;
void initialize(int n){
for (int i = 0;i < 1505;i++) {
cnt[i] = 1;
}
}
int hasEdge(int a, int b){
if (cnt[a] == 1 || cnt[b] == 1) {
int inset = -1;
if (block.find(a) == block.end()) inset = a, block.insert(a);
if (block.find(b) == block.end()) inset = b, block.insert(b);
for (int i = 0;i < 1505;i++) {
if (i != a && i != b) {
if (!bits[inset][i]) {
cnt[i]++;
}
} else {
cnt[i] = -100000;
}
}
bits[a][b] = bits[b][a] = 1;
return 1;
} else {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...