# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
386662 | ismoilov | Game (IOI14_game) | C++14 | 2 ms | 384 KiB |
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<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).end()
#define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
#define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
#define fv(c) for(int (a) = (1); (a) <= (c); (a)++)
#define fz(c) for(int (a) = (0); (a) < (c); (a)++)
#define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--)
#define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--)
#define pb push_back
#define in insert
#define ss second
#define ff first
int ad = 0, nn;
set <int> a, b;
void initialize(int n) {
nn = (n-1)*n/2;
fp(i,0,n/2)
a.in(i);
fp(i,n/2,n)
b.in(i);
nn = nn - ((a.size()-1)*a.size()/2) - ((b.size()-1)*b.size()/2);
}
int hasEdge(int x, int y)
{
if((a.count(x) == 1 && a.count(y)) == 1 || (b.count(x) == 1 && b.count(y) == 1)){
return 1;
}
else{
if(ad == nn-1)
return 1;
ad ++;
return 0;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |