# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
261128 |
2020-08-11T12:13:52 Z |
sjimed |
Stray Cat (JOI20_stray) |
C++14 |
|
71 ms |
16144 KB |
#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define em emplace
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 1e18;
const int inf = 1e9;
static vector<pii> g[20010];
static vector<int> ret;
static int tb[6] = {0, 1, 0, 0, 1, 1};
static void dfs(int x, int p, int k) {
int t = 1 - tb[k];
if(x != 0 && g[x].size() == 2) t = (k + 1) % 6;
for(auto i : g[x]) {
if(i.fi == p) continue;
ret[i.se] = tb[t];
dfs(i.fi, x, t);
}
}
std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) {
for(int i=0; i<M; i++)
g[U[i]].eb(V[i], i), g[V[i]].eb(U[i], i);
ret.resize(M, 0);
dfs(0, 0, 0);
/*for(auto i : ret) {
cout << i;
}
cout << endl;*/
return ret;
}
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define em emplace
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 1e18;
const int inf = 1e9;
static int cnt, mask, prv = -1;
static bool flag = false;
static int a, b;
void Init(int A, int B) {
a = A;
b = B;
}
int Move(std::vector<int> y) {
cnt++;
int d = y[0] + y[1];
if(prv != -1) d++;
if(flag){
if(d>=3) {
return prv = 1 - prv;
}
return prv = y[1];
}
if(d==1){
flag=true;
if(cnt>1) return -1;
if(y[0])prv=0;
else prv=1;
return prv;
}
if(d>=3){
if(cnt>1) y[prv]++;
flag=true;
int tmp;
if(y[0]==1) tmp=0;
else tmp=1;
if(tmp==prv&&cnt>1)return -1;
prv=tmp;
return tmp;
}
if(cnt<=3){
if(y[0])prv=0;
else prv=1;
if(cnt==1)mask*=2, mask+=y[1]-prv;
mask*=2, mask+=prv;
return prv;
}
if(cnt==4){
flag=true;
int opp;
if(y[0])opp=0;
else opp=1;
mask*=2, mask+=opp;
if(mask==25||mask==18||mask==5||mask==11||mask==22||mask==12){
prv=opp;
return prv;
}
return -1;
}
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:75:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
53 ms |
16144 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
53 ms |
16144 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
13692 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
38 ms |
12796 KB |
Output is correct |
4 |
Correct |
66 ms |
15384 KB |
Output is correct |
5 |
Correct |
63 ms |
15368 KB |
Output is correct |
6 |
Correct |
46 ms |
13180 KB |
Output is correct |
7 |
Incorrect |
43 ms |
13320 KB |
Wrong Answer [6] |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
13692 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
38 ms |
12796 KB |
Output is correct |
4 |
Correct |
66 ms |
15384 KB |
Output is correct |
5 |
Correct |
63 ms |
15368 KB |
Output is correct |
6 |
Correct |
46 ms |
13180 KB |
Output is correct |
7 |
Incorrect |
43 ms |
13320 KB |
Wrong Answer [6] |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1536 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
2 ms |
1536 KB |
Output is correct |
4 |
Correct |
2 ms |
1792 KB |
Output is correct |
5 |
Correct |
2 ms |
1792 KB |
Output is correct |
6 |
Correct |
2 ms |
1792 KB |
Output is correct |
7 |
Correct |
2 ms |
1792 KB |
Output is correct |
8 |
Correct |
2 ms |
1792 KB |
Output is correct |
9 |
Correct |
2 ms |
1792 KB |
Output is correct |
10 |
Correct |
3 ms |
1792 KB |
Output is correct |
11 |
Correct |
2 ms |
1792 KB |
Output is correct |
12 |
Correct |
2 ms |
1536 KB |
Output is correct |
13 |
Correct |
2 ms |
2048 KB |
Output is correct |
14 |
Correct |
2 ms |
1792 KB |
Output is correct |
15 |
Correct |
3 ms |
1792 KB |
Output is correct |
16 |
Correct |
2 ms |
1536 KB |
Output is correct |
17 |
Correct |
3 ms |
1792 KB |
Output is correct |
18 |
Correct |
2 ms |
1536 KB |
Output is correct |
19 |
Correct |
2 ms |
1536 KB |
Output is correct |
20 |
Correct |
2 ms |
1536 KB |
Output is correct |
21 |
Correct |
2 ms |
1536 KB |
Output is correct |
22 |
Correct |
2 ms |
1536 KB |
Output is correct |
23 |
Correct |
2 ms |
1536 KB |
Output is correct |
24 |
Correct |
2 ms |
1536 KB |
Output is correct |
25 |
Correct |
3 ms |
1548 KB |
Output is correct |
26 |
Correct |
2 ms |
1536 KB |
Output is correct |
27 |
Correct |
2 ms |
1536 KB |
Output is correct |
28 |
Correct |
2 ms |
1536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
11604 KB |
Output is correct |
2 |
Correct |
55 ms |
12584 KB |
Output is correct |
3 |
Correct |
1 ms |
1536 KB |
Output is correct |
4 |
Correct |
37 ms |
11328 KB |
Output is correct |
5 |
Correct |
56 ms |
13856 KB |
Output is correct |
6 |
Correct |
57 ms |
13852 KB |
Output is correct |
7 |
Correct |
45 ms |
12796 KB |
Output is correct |
8 |
Correct |
45 ms |
12948 KB |
Output is correct |
9 |
Correct |
61 ms |
13824 KB |
Output is correct |
10 |
Correct |
55 ms |
14032 KB |
Output is correct |
11 |
Correct |
55 ms |
14028 KB |
Output is correct |
12 |
Correct |
55 ms |
13692 KB |
Output is correct |
13 |
Correct |
56 ms |
13832 KB |
Output is correct |
14 |
Correct |
55 ms |
13820 KB |
Output is correct |
15 |
Correct |
55 ms |
13840 KB |
Output is correct |
16 |
Correct |
59 ms |
13984 KB |
Output is correct |
17 |
Correct |
52 ms |
13436 KB |
Output is correct |
18 |
Correct |
52 ms |
13460 KB |
Output is correct |
19 |
Correct |
54 ms |
13476 KB |
Output is correct |
20 |
Correct |
52 ms |
13428 KB |
Output is correct |
21 |
Correct |
55 ms |
13456 KB |
Output is correct |
22 |
Correct |
59 ms |
13576 KB |
Output is correct |
23 |
Correct |
44 ms |
11724 KB |
Output is correct |
24 |
Correct |
43 ms |
11744 KB |
Output is correct |
25 |
Correct |
47 ms |
11908 KB |
Output is correct |
26 |
Correct |
46 ms |
11916 KB |
Output is correct |
27 |
Correct |
62 ms |
12708 KB |
Output is correct |
28 |
Correct |
54 ms |
12580 KB |
Output is correct |
29 |
Correct |
55 ms |
12668 KB |
Output is correct |
30 |
Correct |
57 ms |
12640 KB |
Output is correct |
31 |
Correct |
46 ms |
11620 KB |
Output is correct |
32 |
Correct |
48 ms |
11516 KB |
Output is correct |
33 |
Correct |
44 ms |
11772 KB |
Output is correct |
34 |
Correct |
44 ms |
11980 KB |
Output is correct |
35 |
Correct |
51 ms |
12792 KB |
Output is correct |
36 |
Correct |
54 ms |
12628 KB |
Output is correct |
37 |
Correct |
57 ms |
12640 KB |
Output is correct |
38 |
Correct |
53 ms |
12540 KB |
Output is correct |
39 |
Correct |
54 ms |
12544 KB |
Output is correct |
40 |
Correct |
49 ms |
12412 KB |
Output is correct |
41 |
Correct |
54 ms |
13556 KB |
Output is correct |
42 |
Correct |
50 ms |
13132 KB |
Output is correct |
43 |
Correct |
55 ms |
13180 KB |
Output is correct |
44 |
Correct |
54 ms |
13156 KB |
Output is correct |
45 |
Correct |
54 ms |
13052 KB |
Output is correct |
46 |
Correct |
54 ms |
13144 KB |
Output is correct |
47 |
Correct |
50 ms |
12156 KB |
Output is correct |
48 |
Correct |
50 ms |
12312 KB |
Output is correct |
49 |
Correct |
51 ms |
12312 KB |
Output is correct |
50 |
Correct |
48 ms |
12440 KB |
Output is correct |
51 |
Correct |
44 ms |
11704 KB |
Output is correct |
52 |
Correct |
44 ms |
11692 KB |
Output is correct |
53 |
Correct |
48 ms |
11644 KB |
Output is correct |
54 |
Correct |
44 ms |
11644 KB |
Output is correct |
55 |
Correct |
46 ms |
11516 KB |
Output is correct |
56 |
Correct |
49 ms |
11644 KB |
Output is correct |
57 |
Correct |
45 ms |
11716 KB |
Output is correct |
58 |
Correct |
44 ms |
11728 KB |
Output is correct |
59 |
Correct |
47 ms |
11748 KB |
Output is correct |
60 |
Correct |
45 ms |
11824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
45 ms |
11616 KB |
Output is correct |
2 |
Correct |
47 ms |
12332 KB |
Output is correct |
3 |
Correct |
1 ms |
1536 KB |
Output is correct |
4 |
Correct |
40 ms |
11128 KB |
Output is correct |
5 |
Correct |
58 ms |
13968 KB |
Output is correct |
6 |
Correct |
56 ms |
13684 KB |
Output is correct |
7 |
Correct |
44 ms |
12948 KB |
Output is correct |
8 |
Correct |
46 ms |
12796 KB |
Output is correct |
9 |
Correct |
55 ms |
13704 KB |
Output is correct |
10 |
Correct |
54 ms |
13680 KB |
Output is correct |
11 |
Correct |
57 ms |
13684 KB |
Output is correct |
12 |
Correct |
55 ms |
13708 KB |
Output is correct |
13 |
Correct |
55 ms |
13708 KB |
Output is correct |
14 |
Correct |
65 ms |
13832 KB |
Output is correct |
15 |
Correct |
61 ms |
13900 KB |
Output is correct |
16 |
Correct |
61 ms |
14016 KB |
Output is correct |
17 |
Correct |
55 ms |
13464 KB |
Output is correct |
18 |
Correct |
56 ms |
13468 KB |
Output is correct |
19 |
Correct |
71 ms |
13428 KB |
Output is correct |
20 |
Correct |
57 ms |
13428 KB |
Output is correct |
21 |
Correct |
53 ms |
13308 KB |
Output is correct |
22 |
Correct |
58 ms |
13460 KB |
Output is correct |
23 |
Correct |
48 ms |
11620 KB |
Output is correct |
24 |
Correct |
46 ms |
11516 KB |
Output is correct |
25 |
Correct |
46 ms |
11800 KB |
Output is correct |
26 |
Correct |
44 ms |
11644 KB |
Output is correct |
27 |
Correct |
51 ms |
12640 KB |
Output is correct |
28 |
Correct |
51 ms |
12704 KB |
Output is correct |
29 |
Correct |
51 ms |
12660 KB |
Output is correct |
30 |
Correct |
50 ms |
12788 KB |
Output is correct |
31 |
Correct |
45 ms |
11624 KB |
Output is correct |
32 |
Correct |
46 ms |
11632 KB |
Output is correct |
33 |
Correct |
47 ms |
11904 KB |
Output is correct |
34 |
Correct |
47 ms |
11784 KB |
Output is correct |
35 |
Correct |
51 ms |
12640 KB |
Output is correct |
36 |
Correct |
53 ms |
12412 KB |
Output is correct |
37 |
Correct |
65 ms |
12460 KB |
Output is correct |
38 |
Correct |
50 ms |
12508 KB |
Output is correct |
39 |
Correct |
51 ms |
12412 KB |
Output is correct |
40 |
Correct |
48 ms |
12640 KB |
Output is correct |
41 |
Correct |
52 ms |
13136 KB |
Output is correct |
42 |
Correct |
55 ms |
13128 KB |
Output is correct |
43 |
Correct |
56 ms |
13136 KB |
Output is correct |
44 |
Correct |
55 ms |
13044 KB |
Output is correct |
45 |
Correct |
57 ms |
13144 KB |
Output is correct |
46 |
Correct |
57 ms |
13252 KB |
Output is correct |
47 |
Correct |
48 ms |
12332 KB |
Output is correct |
48 |
Correct |
49 ms |
12540 KB |
Output is correct |
49 |
Correct |
53 ms |
12308 KB |
Output is correct |
50 |
Correct |
50 ms |
12328 KB |
Output is correct |
51 |
Correct |
46 ms |
11712 KB |
Output is correct |
52 |
Correct |
51 ms |
11644 KB |
Output is correct |
53 |
Correct |
45 ms |
11708 KB |
Output is correct |
54 |
Correct |
48 ms |
11684 KB |
Output is correct |
55 |
Correct |
46 ms |
11696 KB |
Output is correct |
56 |
Correct |
47 ms |
11712 KB |
Output is correct |
57 |
Correct |
45 ms |
11732 KB |
Output is correct |
58 |
Correct |
44 ms |
11728 KB |
Output is correct |
59 |
Correct |
46 ms |
11760 KB |
Output is correct |
60 |
Correct |
51 ms |
11744 KB |
Output is correct |