#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30;
namespace {
int FunctionExample(int i, int A) {
return i % A;
}
}
vector<int> Mark(int n, int m, int A, int B,
std::vector<int> U, std::vector<int> V) {
vector<int> X(m, -1);
vector<vector<pii>> g(n);
for(int i = 0; i < m; ++i){
g[U[i]].pb({V[i], i});
g[V[i]].pb({U[i], i});
}
vi vis(n + 1);
vis[0] = 1;
queue<int> q;
vi par(n + 1);
vi col(n + 1);
q.push(0);
while(!q.empty()){
int v = q.front(); q.pop();
for(auto [u, idx]: g[v]){
if(!vis[u]){
par[u] = v;
q.push(u);
X[idx] = col[v] ^ 1;
col[u] = col[v] ^ 1;
vis[u] = 1;
}else{
if(X[idx] == -1) X[idx] = 2;
}
}
}
// for(int i = 0 ; i< m; ++i){
// cerr << U[i] << ' ' << V[i] << ' ' << X[i] << '\n';
// }
return X;
}
/* Author : Mychecksdead */
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30;
namespace {
int last_col = -1;
int A, B;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(std::vector<int> y) {
if(last_col == -1){
if(y[0] == 1) return last_col = 0;
return last_col = 1;
}
assert(y[last_col^1] == 1);
if(last_col == 0) return last_col = 1;
return last_col = 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |