题目:Adrien and Austin
Adrien and Austin are playing a game with rocks. Initially, there are N rocks, indexed from 1 to N. In one move, the player chooses at least 1 and at most K consecutively indexed rocks (all of them should not have been removed) and removes them from the game. Adrien always starts the game, and then Adrien and Austin take turns making moves. The player who is unable to make a move (because all rocks are removed) loses. Given N, K, find who is going to win the game (assuming they are smart and are playing optimally).
Input:
The first line contains two integers N, K (0 ≤ N ≤ 106 , 1 ≤ K ≤ 106 ).
Output:
Print a name (“Adrien” or “Austin”, without the quotes) — the person who is going to win the game.*
Examples
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a==0)
cout<<"Austin"<<endl;
else if(a<=b)
cout<<"Adrien"<<endl;
else if(b==1){
if(a%2==0)
cout<<"Austin"<<endl;
else
cout<<"Adrien"<<endl;
}
else{
cout<<"Adrien"<<endl;
}
}