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;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second
const int N=2e4+5;
vector<pi> adj[N];
int z[N];
vector<int> Mark(int n, int m, int A, int B, vector<int> u, vector<int> v) {
if (A<3) exit(0);
forn(i,m) {
adj[u[i]].pb({v[i],i});
adj[v[i]].pb({u[i],i});
}
queue<int> q; q.push(0);
vector<int> vis(n); vis[0]=1;
vector<int> d(n);
while (q.size()) {
int u=q.front(); q.pop();
for(auto&e:adj[u]) {
int v=e.f, i=e.s;
if (!z[i]) {
z[i] = (d[u]%3)+1;
}
if (vis[v]) continue;
vis[v]=1;
q.push(v);
d[v]=d[u]+1;
}
}
vector<int> ans(m);
forn(i,m) ans[i]=z[i]-1;
return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second
void Init(int A, int B) {
if (A<3) exit(0);
}
int Move(vector<int> a) {
if (a[0]&&a[2]) return 2;
if (a[0]&&a[1]) return 0;
if (a[1]&&a[2]) return 1;
forn(i,3) if (a[i]) return i;
}
Compilation message (stderr)
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }
| ^
# | 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... |