This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include <iostream>
#include <vector>
#include <set>
using namespace std;
int N;
vector<int> connected(1502,0);
void initialize(int n) {
N = n;
}
int hasEdge(int u, int v) {
if(u==v){
return 1;
}
// cout << "u size " << asked[u].size() << " " << u << " " << v << " " << find_parent(u) << endl;
// if(find_parent(u) == v)
// return 1;
// if(find_parent(v) == u)
// return 1;
if(u<v){
swap(u,v);
}
connected[u]++;
// connected[v]++;
// cout << "u-"<<u << " v-" << v << " c[u]-" << connected[u] << " c[v]-" << connected[v] << endl;
if(connected[u] == u){
return 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... |