QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#40076#4251. GameZeinDaner#0 1ms3908kbC++17550b2022-07-16 04:44:262024-05-26 01:01:44

Judging History

你现在查看的是最新测评结果

  • [2024-05-26 01:01:44]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3908kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-07-16 04:44:26]
  • 提交

answer

#include "game.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
const int MAX_N=3e5+10;
bool vis[MAX_N];
vector<vi> G;
int K,N;
void init(int n, int k) {
  K=k;
  N=n;
  G.resize(n+1);
  for(int i=0;i<k-1;i++){
    G[i].push_back(i+1);
  }
}
bool dfs(int u){
  vis[u]=1;
  bool ans=0;
  for(auto &v:G[u]){
    if(vis[v] && v<K) return 1;
    if(!vis[v]) ans|=dfs(v);
  }
  return ans;
}
int add_teleporter(int u, int v) {
  G[u].push_back(v);
  for(int i=0;i<=N;i++) vis[i]=0;
  return dfs(0);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 2
Accepted
time: 0ms
memory: 3908kb

input:

1 1
1
893123 893123
-1

output:

0

result:

ok interaction finished.

Test #2:

score: -2
Wrong Answer
time: 1ms
memory: 3776kb

input:

9 9
29
893122 893124
893121 893127
893120 893124
893123 893121
893122 893131
893125 893131
893121 893126
893123 893126
893126 893131
893123 893131
893123 893125
893123 893124
893127 893125
893120 893126
893123 893120
893121 893131
893123 893127
893122 893126
893122 893127
893127 893131
893122 893125...

output:

0

result:

wrong answer Wrong Answer [1]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

0%