Submission #983822

# Submission time Handle Problem Language Result Execution time Memory
983822 2024-05-16T07:00:35 Z vjudge1 Game (APIO22_game) C++17
2 / 100
3 ms 4952 KB
#include <time.h>
#include <cstdlib>
#include <stack>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <map>
#include <set>
#include <iterator>
#include <deque>
#include <queue>
#include <sstream>
#include <array>
#include <string>
#include <tuple>
#include <chrono>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <list>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <bitset>

#include "game.h"
#define ll long long
using namespace std;
vector<int> g[200005];
bool ok = 0, f = 0;;
bool us[200005];
int N, K;
void dfs(int p){
  us[p] = 1;
  for(int to : g[p]){
    if(to < K && p >= K) f = 1;
    if(us[to]) continue;
    dfs(to);
  }
}
void init(int n, int k){
  for(int i = 0; i < k - 1; i++)
    g[i].push_back(i + 1);
  N = n;
  K = k;
}

int add_teleporter(int u, int v) {
  g[u].push_back(v);
  if(u < K && v < K && u >= v) return 1;
  f = 0;
  for(int i = 0; i <= N; i++) us[i] = 0;
  dfs(0);
  if(f == 1) return 1;
  else return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 3 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 3 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 1 ms 4952 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
11 Incorrect 1 ms 4952 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 3 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 1 ms 4952 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
11 Incorrect 1 ms 4952 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 3 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 1 ms 4952 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
11 Incorrect 1 ms 4952 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 2 ms 4952 KB Output is correct
5 Correct 3 ms 4952 KB Output is correct
6 Correct 2 ms 4952 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 1 ms 4952 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
11 Incorrect 1 ms 4952 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -