| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 953765 | De3b0o | Game (APIO22_game) | C++17 | 4046 ms | 51848 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;
bitset<900000000> path(0);
int K , N;
void init(int n, int k)
{
N=n;
K=k;
for(int i = 0 ; k>i ; i++)
for(int j = i+1 ; k>j ; j++)
path[j+i*N]=1;
}
int add_teleporter(int u, int v)
{
if(path[v+u*N])
return 0;
path[v+u*N]=1;
for(int i = 0 ; N>i ; i++)
{
if(path[u+i*N])
{
path[v+i*N]=1;
for(int j = 0 ; N>j ; j++)
{
if(path[j+v*N])
path[j+i*N]=1;
}
}
}
for(int i = 0 ; N>i ; i++)
if(path[i+v*N])
path[i+u*N]=1;
for(int i = 0 ; K>i ; i++)
{
if(path[i+i*N])
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
