답안 #742571

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
742571 2023-05-16T13:15:40 Z keisuke6 게임 (APIO22_game) C++17
30 / 100
281 ms 49212 KB
#include "game.h"
#include <iostream>
#include <vector>
#include <set>
#include <queue>
using namespace std;
 
vector<vector<vector<int>>> G(1001,vector<vector<int>>(1010));
vector<vector<bool>> P(1001,vector<bool>(1010,false));
int N,K;
void init(int n, int k) {
  N = n;
  K = k;
  for(int i=0;i<k;i++)for(int j=i;j<k;j++) P[i][j] = true;
}
int add_teleporter(int u, int v) {
  for(int i=0;i<K;i++){
    G[i][u].push_back(v);
    if(!P[i][u]){
      continue;
    }
    queue<int> q;
    q.push(u);
    while(!q.empty()){
      int pos = q.front();
      q.pop();
      for(int x:G[i][pos]){
        if(P[i][x]){
          if(x <= i) return 1;
          continue;
        }
        P[i][x] = true;
        q.push(x);
      }
      G[i][pos].clear();
    }
  }
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 24144 KB Output is correct
2 Correct 14 ms 24224 KB Output is correct
3 Correct 16 ms 24484 KB Output is correct
4 Correct 14 ms 24264 KB Output is correct
5 Correct 15 ms 24528 KB Output is correct
6 Correct 15 ms 24528 KB Output is correct
7 Correct 16 ms 24496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 24144 KB Output is correct
2 Correct 14 ms 24224 KB Output is correct
3 Correct 16 ms 24484 KB Output is correct
4 Correct 14 ms 24264 KB Output is correct
5 Correct 15 ms 24528 KB Output is correct
6 Correct 15 ms 24528 KB Output is correct
7 Correct 16 ms 24496 KB Output is correct
8 Correct 13 ms 24144 KB Output is correct
9 Correct 14 ms 24144 KB Output is correct
10 Correct 14 ms 24144 KB Output is correct
11 Correct 16 ms 24224 KB Output is correct
12 Correct 14 ms 24272 KB Output is correct
13 Correct 14 ms 24268 KB Output is correct
14 Correct 17 ms 24288 KB Output is correct
15 Correct 15 ms 24272 KB Output is correct
16 Correct 14 ms 24280 KB Output is correct
17 Correct 16 ms 24352 KB Output is correct
18 Correct 15 ms 24252 KB Output is correct
19 Correct 15 ms 24272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 24144 KB Output is correct
2 Correct 14 ms 24224 KB Output is correct
3 Correct 16 ms 24484 KB Output is correct
4 Correct 14 ms 24264 KB Output is correct
5 Correct 15 ms 24528 KB Output is correct
6 Correct 15 ms 24528 KB Output is correct
7 Correct 16 ms 24496 KB Output is correct
8 Correct 13 ms 24144 KB Output is correct
9 Correct 14 ms 24144 KB Output is correct
10 Correct 14 ms 24144 KB Output is correct
11 Correct 16 ms 24224 KB Output is correct
12 Correct 14 ms 24272 KB Output is correct
13 Correct 14 ms 24268 KB Output is correct
14 Correct 17 ms 24288 KB Output is correct
15 Correct 15 ms 24272 KB Output is correct
16 Correct 14 ms 24280 KB Output is correct
17 Correct 16 ms 24352 KB Output is correct
18 Correct 15 ms 24252 KB Output is correct
19 Correct 15 ms 24272 KB Output is correct
20 Correct 16 ms 24412 KB Output is correct
21 Correct 16 ms 24608 KB Output is correct
22 Correct 25 ms 26940 KB Output is correct
23 Correct 16 ms 24528 KB Output is correct
24 Correct 72 ms 36384 KB Output is correct
25 Correct 115 ms 34292 KB Output is correct
26 Correct 44 ms 27808 KB Output is correct
27 Correct 281 ms 40516 KB Output is correct
28 Correct 102 ms 33840 KB Output is correct
29 Correct 175 ms 41272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 24144 KB Output is correct
2 Correct 14 ms 24224 KB Output is correct
3 Correct 16 ms 24484 KB Output is correct
4 Correct 14 ms 24264 KB Output is correct
5 Correct 15 ms 24528 KB Output is correct
6 Correct 15 ms 24528 KB Output is correct
7 Correct 16 ms 24496 KB Output is correct
8 Correct 13 ms 24144 KB Output is correct
9 Correct 14 ms 24144 KB Output is correct
10 Correct 14 ms 24144 KB Output is correct
11 Correct 16 ms 24224 KB Output is correct
12 Correct 14 ms 24272 KB Output is correct
13 Correct 14 ms 24268 KB Output is correct
14 Correct 17 ms 24288 KB Output is correct
15 Correct 15 ms 24272 KB Output is correct
16 Correct 14 ms 24280 KB Output is correct
17 Correct 16 ms 24352 KB Output is correct
18 Correct 15 ms 24252 KB Output is correct
19 Correct 15 ms 24272 KB Output is correct
20 Correct 16 ms 24412 KB Output is correct
21 Correct 16 ms 24608 KB Output is correct
22 Correct 25 ms 26940 KB Output is correct
23 Correct 16 ms 24528 KB Output is correct
24 Correct 72 ms 36384 KB Output is correct
25 Correct 115 ms 34292 KB Output is correct
26 Correct 44 ms 27808 KB Output is correct
27 Correct 281 ms 40516 KB Output is correct
28 Correct 102 ms 33840 KB Output is correct
29 Correct 175 ms 41272 KB Output is correct
30 Runtime error 34 ms 49212 KB Execution killed with signal 11
31 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 24144 KB Output is correct
2 Correct 14 ms 24224 KB Output is correct
3 Correct 16 ms 24484 KB Output is correct
4 Correct 14 ms 24264 KB Output is correct
5 Correct 15 ms 24528 KB Output is correct
6 Correct 15 ms 24528 KB Output is correct
7 Correct 16 ms 24496 KB Output is correct
8 Correct 13 ms 24144 KB Output is correct
9 Correct 14 ms 24144 KB Output is correct
10 Correct 14 ms 24144 KB Output is correct
11 Correct 16 ms 24224 KB Output is correct
12 Correct 14 ms 24272 KB Output is correct
13 Correct 14 ms 24268 KB Output is correct
14 Correct 17 ms 24288 KB Output is correct
15 Correct 15 ms 24272 KB Output is correct
16 Correct 14 ms 24280 KB Output is correct
17 Correct 16 ms 24352 KB Output is correct
18 Correct 15 ms 24252 KB Output is correct
19 Correct 15 ms 24272 KB Output is correct
20 Correct 16 ms 24412 KB Output is correct
21 Correct 16 ms 24608 KB Output is correct
22 Correct 25 ms 26940 KB Output is correct
23 Correct 16 ms 24528 KB Output is correct
24 Correct 72 ms 36384 KB Output is correct
25 Correct 115 ms 34292 KB Output is correct
26 Correct 44 ms 27808 KB Output is correct
27 Correct 281 ms 40516 KB Output is correct
28 Correct 102 ms 33840 KB Output is correct
29 Correct 175 ms 41272 KB Output is correct
30 Runtime error 34 ms 49212 KB Execution killed with signal 11
31 Halted 0 ms 0 KB -