#include "Joi.h"
#include <bits/stdc++.h>
#define F(i,s,n) for(int i=s;i<n;i++)
#define EB emplace_back
#define G(i,x) get<i>(x)
using namespace std;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long long ll;
typedef vector<ii> vii;
static ll x;
static int vis[10005],cnt;
static vi adj[10005];
static void dfs(int v){
if((1LL<<cnt++%60)&x){
MessageBoard(v,1);
}
else MessageBoard(v,0);
for(int u:adj[v]){
if(!vis[u]){
vis[u]=1;
dfs(u);
}
}
}
void Joi(int N, int M, int A[], int B[], long long X, int T) {
x=X;
F(i,0,M){
adj[A[i]].EB(B[i]);
adj[B[i]].EB(A[i]);
}
vis[0]=1;
dfs(0);
}
#include "Ioi.h"
#include <bits/stdc++.h>
#define F(i,s,n) for(int i=s;i<n;i++)
#define EB emplace_back
#define G(i,x) get<i>(x)
using namespace std;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long long ll;
typedef vector<ii> vii;
static ll x;
static int vis[10005],p,hp,cnt,qcnt,pcnt;
static vi adj[10005];
static void dfs(int v){
int ccnt=cnt++;
if(v==p){
pcnt=ccnt;
hp=1;
}
for(int u:adj[v]){
if(!vis[u]){
vis[u]=1;
if(hp&&qcnt<120){
if(Move(u))x|=(1LL<<(ccnt+1)%60);
qcnt++;
}
dfs(u);
if(hp&&qcnt<120){
if(Move(v))x|=(1LL<<ccnt%60);
qcnt++;
}
}
}
}
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
p=P;
F(i,0,M){
adj[A[i]].EB(B[i]);
adj[B[i]].EB(A[i]);
}
vis[0]=1;
dfs(0);
//if(V)x|=(1<<pcnt%60);
return x;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
1144 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
36 ms |
4304 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
4592 KB |
Output is correct |
2 |
Correct |
4 ms |
4592 KB |
Output is correct |
3 |
Correct |
4 ms |
4592 KB |
Output is correct |
4 |
Correct |
6 ms |
4592 KB |
Output is correct |
5 |
Correct |
6 ms |
4592 KB |
Output is correct |
6 |
Correct |
6 ms |
4592 KB |
Output is correct |
7 |
Correct |
6 ms |
4592 KB |
Output is correct |
8 |
Correct |
6 ms |
4592 KB |
Output is correct |
9 |
Correct |
18 ms |
4592 KB |
Output is correct |
10 |
Correct |
16 ms |
4616 KB |
Output is correct |
11 |
Correct |
18 ms |
4736 KB |
Output is correct |
12 |
Correct |
5 ms |
4832 KB |
Output is correct |
13 |
Correct |
4 ms |
4832 KB |
Output is correct |
14 |
Correct |
4 ms |
4832 KB |
Output is correct |
15 |
Correct |
4 ms |
4832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
33 ms |
5188 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
33 ms |
5384 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |