| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 912758 | amirhoseinfar1385 | Stray Cat (JOI20_stray) | C++17 | 0 ms | 0 KiB |
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 "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
namespace {
int a,b,peydashod=0,last=-1;
vector<int>tofy;
}
void Init(int A, int B) {
a=A;
b=B;
}
int Move(std::vector<int> y) {
if(a>=3){
vector<int>tof;
for(int i=0;i<(int)y.size();i++){
if(y[i]!=0){
tof.push_back(i);
}
}
if((int)tof.size()==0){
return -1;
}
if((int)tof.size()==1){
return tof[0];
}
if(tof[0]==0&&tof[1]==1){
return 0;
}
if(tof[0]==0&&tof[1]==2){
return 2;
}
if(tof[0]==1&&tof[1]==2){
return 1;
}
}
if(y[0]>1){
last=1;
peydashod=1;
return 1;
}
if(y[1]>1){
last=0;
peydashod=1;
return 0;
}
if(peydashod==1){
last^=1;
return last;
}
if(last!=-1){
if(y[0]==0&&y[1]==0){
peydashod=1;
return -1;
}
last^=1;
tofy.push_back(last);
int z=-1;
if(z==-1){
return last;
}
if(z==0){
last^=1;
peydashod=1;
return -1;
}
peydashod=1;
return last;
}
else{
y[last]++;
if(y[0]>1){
last=1;
peydashod=1;
return 1;
}
if(y[1]>1){
last=0;
peydashod=1;
return 0;
}
return last;
}
}
