| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 912758 | amirhoseinfar1385 | 길고양이 (JOI20_stray) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
}
