#include <bits/stdc++.h>
using namespace std;
#include "Anthony.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
namespace {
int FunctionExample(int i, int A) {
return i % A;
}
vector <int> adj[20005];
int dist[20005];
void dfs(int x, int cur){
dist[x] = cur;
for(auto i : adj[x]){
if(!dist[i])dfs(i, cur + 1);
}
}
} // namespace
std::vector<int> Mark(int N, int M, int A, int B,
std::vector<int> U, std::vector<int> V) {
std::vector<int> X(M);
for(int i=0;i<M;i++){
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
dfs(0, 1);
for(int i=0;i<M;i++){
int x = max(dist[U[i]], dist[V[i]]);
if(abs(dist[U[i]] - dist[V[i]]) == 1)X[i] = x % min(A, 3);
else X[i] = (x + 1) % min(A, 3);
}
return X;
}
#include <bits/stdc++.h>
using namespace std;
#include "Catherine.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
namespace {
int A, B;
int variable_example = 0;
int prv= -1;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(std::vector<int> y) {
++variable_example;
if(B != 0){
for (int j = 0; j < A; ++j) {
if (y[j] == 1 && j != prv) {
prv = j;
return j;
}
}
return -1;
}
if(prv != -1){
prv--;
if(prv < 0)prv += 3;
return prv;
}
vector <int> stuf;
int x = -1;
for(int j=0;j<3;j++){
if(y[j] == 1)stuf.push_back(j);
else x = j;
}
if((int)stuf.size() == 1){prv = stuf[0]; return stuf[0];}
else{
if(x == 0)prv = 1;
else if(x == 1)prv = 2;
else prv = 0;
return prv;
}
}
Compilation message
Anthony.cpp:15:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
15 | int FunctionExample(int i, int A) {
| ^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
40 ms |
15508 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
40 ms |
14644 KB |
Output is correct |
4 |
Correct |
59 ms |
16784 KB |
Output is correct |
5 |
Correct |
50 ms |
16780 KB |
Output is correct |
6 |
Correct |
37 ms |
15332 KB |
Output is correct |
7 |
Correct |
35 ms |
15224 KB |
Output is correct |
8 |
Correct |
43 ms |
16100 KB |
Output is correct |
9 |
Correct |
46 ms |
16044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
40 ms |
15508 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
40 ms |
14644 KB |
Output is correct |
4 |
Correct |
59 ms |
16784 KB |
Output is correct |
5 |
Correct |
50 ms |
16780 KB |
Output is correct |
6 |
Correct |
37 ms |
15332 KB |
Output is correct |
7 |
Correct |
35 ms |
15224 KB |
Output is correct |
8 |
Correct |
43 ms |
16100 KB |
Output is correct |
9 |
Correct |
46 ms |
16044 KB |
Output is correct |
10 |
Incorrect |
31 ms |
13264 KB |
Wrong Answer [6] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
13060 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
28 ms |
12532 KB |
Output is correct |
4 |
Correct |
45 ms |
14780 KB |
Output is correct |
5 |
Correct |
52 ms |
14692 KB |
Output is correct |
6 |
Correct |
36 ms |
12872 KB |
Output is correct |
7 |
Correct |
32 ms |
12980 KB |
Output is correct |
8 |
Correct |
39 ms |
13848 KB |
Output is correct |
9 |
Correct |
39 ms |
13864 KB |
Output is correct |
10 |
Correct |
37 ms |
13492 KB |
Output is correct |
11 |
Correct |
45 ms |
13488 KB |
Output is correct |
12 |
Correct |
40 ms |
13612 KB |
Output is correct |
13 |
Correct |
37 ms |
13688 KB |
Output is correct |
14 |
Correct |
48 ms |
13816 KB |
Output is correct |
15 |
Correct |
60 ms |
13728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
13060 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
28 ms |
12532 KB |
Output is correct |
4 |
Correct |
45 ms |
14780 KB |
Output is correct |
5 |
Correct |
52 ms |
14692 KB |
Output is correct |
6 |
Correct |
36 ms |
12872 KB |
Output is correct |
7 |
Correct |
32 ms |
12980 KB |
Output is correct |
8 |
Correct |
39 ms |
13848 KB |
Output is correct |
9 |
Correct |
39 ms |
13864 KB |
Output is correct |
10 |
Correct |
37 ms |
13492 KB |
Output is correct |
11 |
Correct |
45 ms |
13488 KB |
Output is correct |
12 |
Correct |
40 ms |
13612 KB |
Output is correct |
13 |
Correct |
37 ms |
13688 KB |
Output is correct |
14 |
Correct |
48 ms |
13816 KB |
Output is correct |
15 |
Correct |
60 ms |
13728 KB |
Output is correct |
16 |
Incorrect |
30 ms |
11300 KB |
Wrong Answer [6] |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1308 KB |
Output is correct |
2 |
Correct |
1 ms |
1020 KB |
Output is correct |
3 |
Correct |
2 ms |
1280 KB |
Output is correct |
4 |
Correct |
2 ms |
1280 KB |
Output is correct |
5 |
Correct |
2 ms |
1284 KB |
Output is correct |
6 |
Correct |
2 ms |
1284 KB |
Output is correct |
7 |
Correct |
2 ms |
1284 KB |
Output is correct |
8 |
Correct |
2 ms |
1292 KB |
Output is correct |
9 |
Correct |
2 ms |
1292 KB |
Output is correct |
10 |
Correct |
2 ms |
1284 KB |
Output is correct |
11 |
Correct |
2 ms |
1284 KB |
Output is correct |
12 |
Correct |
2 ms |
1296 KB |
Output is correct |
13 |
Correct |
2 ms |
1292 KB |
Output is correct |
14 |
Correct |
2 ms |
1292 KB |
Output is correct |
15 |
Correct |
2 ms |
1292 KB |
Output is correct |
16 |
Correct |
2 ms |
1284 KB |
Output is correct |
17 |
Correct |
2 ms |
1284 KB |
Output is correct |
18 |
Correct |
2 ms |
1284 KB |
Output is correct |
19 |
Correct |
2 ms |
1292 KB |
Output is correct |
20 |
Correct |
3 ms |
1284 KB |
Output is correct |
21 |
Correct |
2 ms |
1280 KB |
Output is correct |
22 |
Correct |
2 ms |
1284 KB |
Output is correct |
23 |
Correct |
2 ms |
1280 KB |
Output is correct |
24 |
Correct |
2 ms |
1296 KB |
Output is correct |
25 |
Correct |
2 ms |
1296 KB |
Output is correct |
26 |
Correct |
2 ms |
1292 KB |
Output is correct |
27 |
Correct |
2 ms |
1284 KB |
Output is correct |
28 |
Correct |
2 ms |
1284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
11108 KB |
Output is correct |
2 |
Correct |
35 ms |
11780 KB |
Output is correct |
3 |
Correct |
1 ms |
1024 KB |
Output is correct |
4 |
Correct |
32 ms |
11004 KB |
Output is correct |
5 |
Correct |
48 ms |
13148 KB |
Output is correct |
6 |
Correct |
40 ms |
13000 KB |
Output is correct |
7 |
Correct |
33 ms |
12160 KB |
Output is correct |
8 |
Incorrect |
30 ms |
12244 KB |
Wrong Answer [6] |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
11300 KB |
Output is correct |
2 |
Correct |
45 ms |
11716 KB |
Output is correct |
3 |
Correct |
1 ms |
1024 KB |
Output is correct |
4 |
Correct |
27 ms |
10860 KB |
Output is correct |
5 |
Correct |
43 ms |
12920 KB |
Output is correct |
6 |
Correct |
59 ms |
13024 KB |
Output is correct |
7 |
Correct |
38 ms |
12292 KB |
Output is correct |
8 |
Incorrect |
39 ms |
12516 KB |
Wrong Answer [6] |
9 |
Halted |
0 ms |
0 KB |
- |