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 <vector>
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
typedef long long int lld;
namespace {
int FunctionExample(int i, int A) {
return i % A;
}
} // namespace
vector<int>nei[1000000];
int dist[1000000];
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);
rep(i,0,N){
dist[i]=-1;
}
rep(i,0,M){
nei[U[i]].push_back(V[i]);
nei[V[i]].push_back(U[i]);
}
dist[0]=0;
queue<int> q;
q.push(0);
while(!q.empty()){
int v=q.front();
q.pop();
trav(a,nei[v]){
if(dist[a]==-1){
dist[a]=dist[v]+1;
q.push(a);
}
}
}
rep(i,0,M){
if(dist[U[i]]==dist[V[i]]){
X[i]=3;
}else{
X[i]=min(dist[U[i]],dist[V[i]])%3;
}
}
//rep(i,0,N)cout<<dist[i]<<endl;
return X;
}
#include "Catherine.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
typedef long long int lld;
namespace {
int A, B;
int variable_example = 0;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(std::vector<int> y) {
++variable_example;
int tot=0;
for (int j = 0; j < 3; ++j) {
if (y[j] != 0) {
tot++;
}
}
if(tot==1){
for (int j = 0; j < 3; ++j) {
if (y[j] != 0) {
return j;
}
}
}
int sum=6;
for (int j = 0; j < 3; ++j) {
if (y[j] != 0) {
//cout<<j<<" ";
sum-=j;
}
}
sum++;
sum%=3;
//cout<<sum<<endl;
return sum;
}
Compilation message (stderr)
Anthony.cpp:12:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
12 | int FunctionExample(int i, int A) {
| ^~~~~~~~~~~~~~~
# | 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... |