#include "Anthony.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(a, b) for(size_t a = 0; a < (size_t)(b); a++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=2e4+10;
int deg[N],kol[N];
bool vis[N];
vi graf[N];
void bfs(){
deque<int> deq;
deq.push_back(0),vis[0]=1;
while(deq.size()){
int v=deq.front();
deq.pop_front();
for(auto u:graf[v]){
if(!vis[u]){
deg[u]=deg[v]+1,vis[u]=1;
deq.push_back(u);
}
}
}
}
vi Mark(int n,int m,int a,int b,vi u,vi v){
rep(i,m) graf[u[i]].push_back(v[i]),graf[v[i]].push_back(u[i]);
bfs();
rep(i,n) kol[i]=(i==0?0:(kol[i-1]+1)%3);
vi res;
rep(i,m) res.push_back(kol[min(deg[u[i]],deg[v[i]])]);
return res;
}
#include "Catherine.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(a, b) for(size_t a = 0; a < (size_t)(b); a++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=2e4+10;
int il;
void Init(int a,int b){
il=a;
}
int Move(vi t){
if(il>=3){
bool c[3];
c[0]=c[1]=c[2]=0;
rep(i,t.size()) c[i]=(t[i]>0?1:0);
if(c[0]>0 and c[1]>0) return 0;
if(c[1]>0 and c[2]>0) return 1;
if(c[2]>0 and c[0]>0) return 2;
if(c[0]) return 0;
if(c[1]) return 1;
return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
15968 KB |
Output is correct |
2 |
Correct |
1 ms |
1008 KB |
Output is correct |
3 |
Correct |
38 ms |
15296 KB |
Output is correct |
4 |
Correct |
55 ms |
17124 KB |
Output is correct |
5 |
Correct |
55 ms |
17124 KB |
Output is correct |
6 |
Correct |
44 ms |
15792 KB |
Output is correct |
7 |
Correct |
49 ms |
15712 KB |
Output is correct |
8 |
Correct |
48 ms |
16452 KB |
Output is correct |
9 |
Correct |
51 ms |
16412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
15968 KB |
Output is correct |
2 |
Correct |
1 ms |
1008 KB |
Output is correct |
3 |
Correct |
38 ms |
15296 KB |
Output is correct |
4 |
Correct |
55 ms |
17124 KB |
Output is correct |
5 |
Correct |
55 ms |
17124 KB |
Output is correct |
6 |
Correct |
44 ms |
15792 KB |
Output is correct |
7 |
Correct |
49 ms |
15712 KB |
Output is correct |
8 |
Correct |
48 ms |
16452 KB |
Output is correct |
9 |
Correct |
51 ms |
16412 KB |
Output is correct |
10 |
Correct |
33 ms |
13832 KB |
Output is correct |
11 |
Correct |
34 ms |
13824 KB |
Output is correct |
12 |
Correct |
34 ms |
13768 KB |
Output is correct |
13 |
Correct |
32 ms |
13792 KB |
Output is correct |
14 |
Correct |
34 ms |
14040 KB |
Output is correct |
15 |
Correct |
37 ms |
14428 KB |
Output is correct |
16 |
Correct |
43 ms |
16540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
13616 KB |
Output is correct |
2 |
Correct |
1 ms |
1004 KB |
Output is correct |
3 |
Correct |
28 ms |
13060 KB |
Output is correct |
4 |
Correct |
45 ms |
14844 KB |
Output is correct |
5 |
Correct |
50 ms |
14916 KB |
Output is correct |
6 |
Correct |
34 ms |
13556 KB |
Output is correct |
7 |
Correct |
34 ms |
13576 KB |
Output is correct |
8 |
Correct |
38 ms |
14188 KB |
Output is correct |
9 |
Correct |
39 ms |
14196 KB |
Output is correct |
10 |
Correct |
41 ms |
13924 KB |
Output is correct |
11 |
Correct |
48 ms |
13944 KB |
Output is correct |
12 |
Correct |
41 ms |
13972 KB |
Output is correct |
13 |
Correct |
39 ms |
13928 KB |
Output is correct |
14 |
Correct |
45 ms |
14336 KB |
Output is correct |
15 |
Correct |
38 ms |
14200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
13616 KB |
Output is correct |
2 |
Correct |
1 ms |
1004 KB |
Output is correct |
3 |
Correct |
28 ms |
13060 KB |
Output is correct |
4 |
Correct |
45 ms |
14844 KB |
Output is correct |
5 |
Correct |
50 ms |
14916 KB |
Output is correct |
6 |
Correct |
34 ms |
13556 KB |
Output is correct |
7 |
Correct |
34 ms |
13576 KB |
Output is correct |
8 |
Correct |
38 ms |
14188 KB |
Output is correct |
9 |
Correct |
39 ms |
14196 KB |
Output is correct |
10 |
Correct |
41 ms |
13924 KB |
Output is correct |
11 |
Correct |
48 ms |
13944 KB |
Output is correct |
12 |
Correct |
41 ms |
13972 KB |
Output is correct |
13 |
Correct |
39 ms |
13928 KB |
Output is correct |
14 |
Correct |
45 ms |
14336 KB |
Output is correct |
15 |
Correct |
38 ms |
14200 KB |
Output is correct |
16 |
Correct |
30 ms |
12068 KB |
Output is correct |
17 |
Correct |
50 ms |
11912 KB |
Output is correct |
18 |
Correct |
40 ms |
11932 KB |
Output is correct |
19 |
Correct |
43 ms |
11932 KB |
Output is correct |
20 |
Correct |
53 ms |
12512 KB |
Output is correct |
21 |
Correct |
42 ms |
12308 KB |
Output is correct |
22 |
Correct |
40 ms |
14412 KB |
Output is correct |
23 |
Correct |
33 ms |
12048 KB |
Output is correct |
24 |
Correct |
34 ms |
12016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1008 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
2880 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
2744 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |