You are viewing a single comment's thread. Return to all comments →
My solution
int player2(int n){
if(n<2) return 1; return (player1(n-5)&&player1(n-3)&&player1(n-2));
}
int player1(int n){
if(n<2) return 0; return (player2(n-5)||player2(n-3)||player2(n-2));
int main() {
int n,t,i,j; scanf("%d",&t); for(int a0=0;a0<t;++a0){ scanf("%d",&n); i = player1(n); if(i==1) printf("First\n"); else printf("Second\n"); } return 0;
Seems like cookies are disabled on this browser, please enable them to open this website
Game of Stones
You are viewing a single comment's thread. Return to all comments →
My solution
int player2(int n){
}
int player1(int n){
}
int main() {
}