Submission #953711

# Submission time Handle Problem Language Result Execution time Memory
953711 2024-03-26T14:22:19 Z De3b0o Game (APIO22_game) C++17
2 / 100
1 ms 2648 KB
#include "game.h"
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
//#define lc (2*n)
//#define rc (2*n+1)

using namespace std;

bitset<900000000> path;


ll K , N;
ll m;

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*30000]=1;
}

int add_teleporter(int u, int v)
{
    m++;
    if(path[v+u*30000]==1)
        return 0;
    path[v+u*30000]=1;
    for(int i = 0 ; N>i ; i++)
    {
        if(path[u+i*30000]==1)
        {
            path[v+i*30000]=1;
            for(int j = 0 ; N>j ; j++)
            {
                if(path[j+v*30000]==1)
                {
                    path[j+u*30000]=1;
                    path[j+i*30000]=1;
                }
            }
        }
    }
    for(int i = 0 ; K>i ; i++)
    {
        if(path[i+i*30000]==1)
            return 1;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 352 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Incorrect 0 ms 600 KB Wrong Answer[1]
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 352 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Incorrect 0 ms 600 KB Wrong Answer[1]
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 352 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Incorrect 0 ms 600 KB Wrong Answer[1]
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 352 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Incorrect 0 ms 600 KB Wrong Answer[1]
13 Halted 0 ms 0 KB -