# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947428 | phoenix0423 | 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 <vector>
#include<bits/stdc++.h>
using namespace std;
int A, B, lst = -1, move = 0, ok = 0;
string ps = "";
void Init(int a, int b){
A = a, B = b;
}
int Move(vector<int> y){
// cout<<"ck : "<<A<<" "<<B<<"\n";
if(lst != -1) y[lst]++;
int deg = accumulate(y.begin(), y.end(), 0);
if(deg == 1){
return max_element(y.begin(), y.end()) - y.begin();
}
if(true){
for(int i = 0; i < A; i++){
// cout<<"try : "<<y[i]<<" "<<y[(i + 1) % A]<<"\n";
if(y[i] == 1 && y[(i + 1) % A]){
return i;
}
}
}
return 0;
if(deg > 2){
if(lst) return lst ^ 1;
else return y[0] != 1;
}
if(ok){
}
}
/*
7 6 3 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/