# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
521990 |
2022-02-03T14:48:42 Z |
new_acc |
Stray Cat (JOI20_stray) |
C++14 |
|
64 ms |
15688 KB |
#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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
15688 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
15688 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
13616 KB |
Output is correct |
2 |
Correct |
1 ms |
1068 KB |
Output is correct |
3 |
Correct |
33 ms |
12988 KB |
Output is correct |
4 |
Correct |
40 ms |
14864 KB |
Output is correct |
5 |
Correct |
55 ms |
14900 KB |
Output is correct |
6 |
Correct |
48 ms |
13676 KB |
Output is correct |
7 |
Correct |
37 ms |
13512 KB |
Output is correct |
8 |
Correct |
42 ms |
14140 KB |
Output is correct |
9 |
Correct |
40 ms |
14196 KB |
Output is correct |
10 |
Correct |
42 ms |
13984 KB |
Output is correct |
11 |
Correct |
38 ms |
13980 KB |
Output is correct |
12 |
Correct |
40 ms |
13984 KB |
Output is correct |
13 |
Correct |
38 ms |
14004 KB |
Output is correct |
14 |
Correct |
41 ms |
14376 KB |
Output is correct |
15 |
Correct |
64 ms |
14228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
13616 KB |
Output is correct |
2 |
Correct |
1 ms |
1068 KB |
Output is correct |
3 |
Correct |
33 ms |
12988 KB |
Output is correct |
4 |
Correct |
40 ms |
14864 KB |
Output is correct |
5 |
Correct |
55 ms |
14900 KB |
Output is correct |
6 |
Correct |
48 ms |
13676 KB |
Output is correct |
7 |
Correct |
37 ms |
13512 KB |
Output is correct |
8 |
Correct |
42 ms |
14140 KB |
Output is correct |
9 |
Correct |
40 ms |
14196 KB |
Output is correct |
10 |
Correct |
42 ms |
13984 KB |
Output is correct |
11 |
Correct |
38 ms |
13980 KB |
Output is correct |
12 |
Correct |
40 ms |
13984 KB |
Output is correct |
13 |
Correct |
38 ms |
14004 KB |
Output is correct |
14 |
Correct |
41 ms |
14376 KB |
Output is correct |
15 |
Correct |
64 ms |
14228 KB |
Output is correct |
16 |
Correct |
30 ms |
12060 KB |
Output is correct |
17 |
Correct |
31 ms |
11940 KB |
Output is correct |
18 |
Correct |
36 ms |
11984 KB |
Output is correct |
19 |
Correct |
40 ms |
11828 KB |
Output is correct |
20 |
Correct |
37 ms |
12584 KB |
Output is correct |
21 |
Correct |
33 ms |
12248 KB |
Output is correct |
22 |
Correct |
46 ms |
14560 KB |
Output is correct |
23 |
Correct |
31 ms |
12028 KB |
Output is correct |
24 |
Correct |
33 ms |
12120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1064 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
2836 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
2796 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |