This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e4;
const int MAX_M = 2e4;
bool vis[MAX_N], visE[MAX_M];
int d[MAX_N];
vector<int> adj[MAX_N];
vector<int> Mark( int N, int M, int A, int B, vector<int> U, vector<int> V ) {
vector<int> X( M );
for ( int i = 0; i < M; i++ ) {
adj[U[i]].push_back( i );
adj[V[i]].push_back( i );
}
queue<int> q;
d[0] = 0;
vis[0] = true;
q.push( 0 );
while ( !q.empty() ) {
int u = q.front();
q.pop();
for ( int e: adj[u] ) {
if ( visE[e] )
continue;
visE[e] = true;
int v = (U[e] == u ? V[e] : U[e]);
X[e] = d[u];
if ( vis[v] )
continue;
d[v] = (d[u] + 1) % 3;
vis[v] = true;
q.push( v );
}
}
return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
void Init(int A, int B) {
A = A;
B = B;
}
int Move( vector<int> y ) {
if ( y[0] > 0 && y[2] == 0 )
return 0;
if ( y[1] > 0 && y[0] == 0 )
return 1;
if ( y[2] > 0 && y[1] == 0 )
return 2;
exit( 1 );
return -1;
}
# | 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... |