#include "Anthony.h"
#include <bits//stdc++.h>
using namespace std;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1))
#define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1))
#define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1))
#define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1))
#define iloop_(m, h, g) for (auto i = m; i != h; i+=g)
#define jloop_(m, h, g) for (auto j = m; j != h; j+=g)
#define kloop_(m, h, g) for (auto k = m; k != h; k+=g)
#define lloop_(m, h, g) for (auto l = m; l != h; l+=g)
#define getchar_unlocked _getchar_nolock // comment before submission
#define pll pair<ll,ll>
#define plll pair<ll, pll>
#define pllll pair<pll, pll>
#define vll vector<ll>
#define qll queue<ll>
#define dll deque<ll>
#define pqll priority_queue<ll>
#define gll greater<ll>
#define INF 1000000000000000
#define MOD1 1000000007
#define MOD2 998244353
#define MOD3 1000000009
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vector<int> X(M);
vector<int> adj[N];
iloop(0, M) {
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
queue<int> q, nq;
q.push(0);
int dist = 1;
bool vis[N] = {};
int dis[N];
dis[0] = 0;
vis[0] = 1;
while (q.size()) {
while (q.size()) {
int nd = q.front();
q.pop();
for (auto it : adj[nd]) {
if (!vis[it]) {
vis[it] = 1;
nq.push(it);
}
}
}
while (nq.size()) {
dis[nq.front()] = dist;
q.push(nq.front());
nq.pop();
}
dist++;
}
//iloop(0, N) cout << dis[i] << " ";
//cout << "\n";
iloop(0, M) {
X[i] = min(dis[U[i]], dis[V[i]])%3;
//cout << X[i] << " ";
}
//cout << "\n";
return X;
}
#include "Catherine.h"
#include <bits//stdc++.h>
using namespace std;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1))
#define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1))
#define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1))
#define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1))
#define iloop_(m, h, g) for (auto i = m; i != h; i+=g)
#define jloop_(m, h, g) for (auto j = m; j != h; j+=g)
#define kloop_(m, h, g) for (auto k = m; k != h; k+=g)
#define lloop_(m, h, g) for (auto l = m; l != h; l+=g)
#define getchar_unlocked _getchar_nolock // comment before submission
#define pll pair<ll,ll>
#define plll pair<ll, pll>
#define pllll pair<pll, pll>
#define vll vector<ll>
#define qll queue<ll>
#define dll deque<ll>
#define pqll priority_queue<ll>
#define gll greater<ll>
#define INF 1000000000000000
#define MOD1 1000000007
#define MOD2 998244353
#define MOD3 1000000009
int oa, ob;
void Init(int A, int B) {
oa = A, ob = B;
}
int Move(vector<int> y) {
//iloop(0, 3) cout << y[i] << " ";
//cout << "\n";
if (y[0] == 0) {
if (y[1] == 0) return 2;
return 1;
}
if (y[1] == 0) {
if (y[2] == 0) return 0;
return 2;
}
if (y[2] == 0) {
if (y[0] == 0) return 1;
return 0;
}
abort();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
15624 KB |
Output is correct |
2 |
Correct |
0 ms |
516 KB |
Output is correct |
3 |
Correct |
32 ms |
14780 KB |
Output is correct |
4 |
Correct |
49 ms |
16412 KB |
Output is correct |
5 |
Correct |
52 ms |
16440 KB |
Output is correct |
6 |
Correct |
37 ms |
15176 KB |
Output is correct |
7 |
Correct |
36 ms |
15204 KB |
Output is correct |
8 |
Correct |
51 ms |
15780 KB |
Output is correct |
9 |
Correct |
40 ms |
15896 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
15624 KB |
Output is correct |
2 |
Correct |
0 ms |
516 KB |
Output is correct |
3 |
Correct |
32 ms |
14780 KB |
Output is correct |
4 |
Correct |
49 ms |
16412 KB |
Output is correct |
5 |
Correct |
52 ms |
16440 KB |
Output is correct |
6 |
Correct |
37 ms |
15176 KB |
Output is correct |
7 |
Correct |
36 ms |
15204 KB |
Output is correct |
8 |
Correct |
51 ms |
15780 KB |
Output is correct |
9 |
Correct |
40 ms |
15896 KB |
Output is correct |
10 |
Correct |
34 ms |
13188 KB |
Output is correct |
11 |
Correct |
40 ms |
13160 KB |
Output is correct |
12 |
Correct |
43 ms |
12936 KB |
Output is correct |
13 |
Correct |
35 ms |
13148 KB |
Output is correct |
14 |
Correct |
36 ms |
13352 KB |
Output is correct |
15 |
Correct |
41 ms |
13756 KB |
Output is correct |
16 |
Correct |
50 ms |
15904 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
12808 KB |
Output is correct |
2 |
Correct |
0 ms |
512 KB |
Output is correct |
3 |
Correct |
31 ms |
12516 KB |
Output is correct |
4 |
Correct |
49 ms |
14328 KB |
Output is correct |
5 |
Correct |
52 ms |
14280 KB |
Output is correct |
6 |
Correct |
37 ms |
12892 KB |
Output is correct |
7 |
Correct |
39 ms |
13092 KB |
Output is correct |
8 |
Correct |
45 ms |
13540 KB |
Output is correct |
9 |
Correct |
41 ms |
13524 KB |
Output is correct |
10 |
Correct |
42 ms |
13584 KB |
Output is correct |
11 |
Correct |
48 ms |
13288 KB |
Output is correct |
12 |
Correct |
41 ms |
13232 KB |
Output is correct |
13 |
Correct |
41 ms |
13304 KB |
Output is correct |
14 |
Correct |
39 ms |
13692 KB |
Output is correct |
15 |
Correct |
52 ms |
13616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
12808 KB |
Output is correct |
2 |
Correct |
0 ms |
512 KB |
Output is correct |
3 |
Correct |
31 ms |
12516 KB |
Output is correct |
4 |
Correct |
49 ms |
14328 KB |
Output is correct |
5 |
Correct |
52 ms |
14280 KB |
Output is correct |
6 |
Correct |
37 ms |
12892 KB |
Output is correct |
7 |
Correct |
39 ms |
13092 KB |
Output is correct |
8 |
Correct |
45 ms |
13540 KB |
Output is correct |
9 |
Correct |
41 ms |
13524 KB |
Output is correct |
10 |
Correct |
42 ms |
13584 KB |
Output is correct |
11 |
Correct |
48 ms |
13288 KB |
Output is correct |
12 |
Correct |
41 ms |
13232 KB |
Output is correct |
13 |
Correct |
41 ms |
13304 KB |
Output is correct |
14 |
Correct |
39 ms |
13692 KB |
Output is correct |
15 |
Correct |
52 ms |
13616 KB |
Output is correct |
16 |
Correct |
37 ms |
11264 KB |
Output is correct |
17 |
Correct |
32 ms |
11348 KB |
Output is correct |
18 |
Correct |
32 ms |
11188 KB |
Output is correct |
19 |
Correct |
32 ms |
11228 KB |
Output is correct |
20 |
Correct |
39 ms |
11744 KB |
Output is correct |
21 |
Correct |
41 ms |
11648 KB |
Output is correct |
22 |
Correct |
46 ms |
13792 KB |
Output is correct |
23 |
Correct |
32 ms |
11336 KB |
Output is correct |
24 |
Correct |
31 ms |
11392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
508 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
2188 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
2180 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |