답안 #953743

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
953743 2024-03-26T15:22:01 Z De3b0o 게임 (APIO22_game) C++17
30 / 100
4000 ms 110612 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(0);


ll K , N;

void init(int n, int k)
{
    N=n;
    K=k;
    for(int i = 0 ; n>i ; i++)
        for(int j = 0 ; n>j ; j++)
            path.reset(j+i*N);
    for(int i = 0 ; k>i ; i++)
        for(int j = i+1 ; k>j ; j++)
            path.set(j+i*N);
}

int add_teleporter(int u, int v)
{
    if(path.test(v+u*N)==1)
        return 0;
    path.set(v+u*N);
    for(int i = 0 ; N>i ; i++)
    {
        if(path.test(u+i*N)==1)
        {
            for(int j = 0 ; N>j ; j++)
            {
                if(path.test(j+v*N)==1)
                    path.set(j+i*N);
            }
        }
    }
    for(int i = 0 ; N>i ; i++)
        if(path.test(i+v*N)==1)
            path.set(i+u*N);
    for(int i = 0 ; N>i ; i++)
        if(path.test(u+i*N)==1)
            path.set(v+i*N);
    for(int i = 0 ; K>i ; i++)
    {
        if(path.test(i+i*N)==1)
            return 1;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 504 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 504 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 8 ms 344 KB Output is correct
21 Correct 3 ms 344 KB Output is correct
22 Correct 12 ms 344 KB Output is correct
23 Correct 9 ms 344 KB Output is correct
24 Correct 218 ms 344 KB Output is correct
25 Correct 321 ms 344 KB Output is correct
26 Correct 376 ms 344 KB Output is correct
27 Correct 506 ms 344 KB Output is correct
28 Correct 103 ms 344 KB Output is correct
29 Correct 247 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 504 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 8 ms 344 KB Output is correct
21 Correct 3 ms 344 KB Output is correct
22 Correct 12 ms 344 KB Output is correct
23 Correct 9 ms 344 KB Output is correct
24 Correct 218 ms 344 KB Output is correct
25 Correct 321 ms 344 KB Output is correct
26 Correct 376 ms 344 KB Output is correct
27 Correct 506 ms 344 KB Output is correct
28 Correct 103 ms 344 KB Output is correct
29 Correct 247 ms 344 KB Output is correct
30 Execution timed out 4062 ms 110612 KB Time limit exceeded
31 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 504 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 8 ms 344 KB Output is correct
21 Correct 3 ms 344 KB Output is correct
22 Correct 12 ms 344 KB Output is correct
23 Correct 9 ms 344 KB Output is correct
24 Correct 218 ms 344 KB Output is correct
25 Correct 321 ms 344 KB Output is correct
26 Correct 376 ms 344 KB Output is correct
27 Correct 506 ms 344 KB Output is correct
28 Correct 103 ms 344 KB Output is correct
29 Correct 247 ms 344 KB Output is correct
30 Execution timed out 4062 ms 110612 KB Time limit exceeded
31 Halted 0 ms 0 KB -