# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
434131 |
2021-06-20T15:28:53 Z |
Odavey |
Game (IOI14_game) |
C++17 |
|
6 ms |
9140 KB |
//
// ~oisín~ C++ Template
//
#include <bits/stdc++.h>
#define MX_N 5001
#define mp make_pair
#define mod7 1000000007
#define modpi 314159
#define PI 3.141592653589793238
#define pb push_back
#define FastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define All(a) a.begin(),a.end()
#define fi first
#define se second
#define ll long long int
#define ull unsigned long long int
int kx[8] = {+2, +2, -2, -2, +1, +1, -1, -1};
int ky[8] = {+1, -1, +1, -1, +2, -2, +2, -2};
int d9x[9] = {+1, +1, +1, +0, +0, +0, -1, -1, -1};
int d9y[9] = {+1, +0, -1, +1, +0, -1, +1, +0, -1};
int dx4[4] = {+0, +0, +1, -1};
int dy4[4] = {+1, -1, +0, +0};
ll gcd(ull a, ull b){
return (a==0)?b:gcd(b%a,a);
}
ll lcm(ull a, ull b){
return a*(b/gcd(a,b));
}
const long long INF = 1e18;
using namespace std;
int V;
int AM[1501][1501];
int connections[1501];
int edges[1501];
void initialize(int n){
memset(AM, -1, sizeof(AM));
memset(edges, 0, sizeof(edges));
memset(connections, 0, sizeof(connections));
V = n;
return;
}
int hasEdge(int u, int v){
if(AM[u][v] != -1){
return AM[u][v];
}
if(edges[u] == V-2 || edges[v] == V-2){
AM[u][v] = 1;
++connections[u];
++connections[v];
}else{
AM[u][v] = 0;
}
++edges[u];
++edges[v];
return AM[u][v];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9036 KB |
Output is correct |
2 |
Correct |
5 ms |
9036 KB |
Output is correct |
3 |
Correct |
6 ms |
9036 KB |
Output is correct |
4 |
Incorrect |
5 ms |
9036 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9036 KB |
Output is correct |
2 |
Correct |
5 ms |
9036 KB |
Output is correct |
3 |
Correct |
6 ms |
9140 KB |
Output is correct |
4 |
Incorrect |
5 ms |
9036 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9036 KB |
Output is correct |
2 |
Correct |
5 ms |
9036 KB |
Output is correct |
3 |
Correct |
6 ms |
9036 KB |
Output is correct |
4 |
Incorrect |
5 ms |
9036 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |