Programmer's love affair
Time limit: 1 Sec memory limit: MB
Submitted by: Resolution: 15
Submitted State
Title DescriptionAlex Love Asd, so they often play together ♂ play, today they play a game again, there is a circle, the circle has n points. Two people take turns operation, because Alex comparison base, so always Alex Initiator, each operation can choose a continuous 1 to k points to delete, finally who can not operate on the lost,if they are smart enough to ask who will win in the end(note that the points taken will be deleted, that is, the latter may be broken into a few chains, each time only a chain up to select a continuous 1 to K interval)InputAn example of a t,t group (a sample of 1W groups), one n and one k for each set (N,k range is 1 to 1e9)Outputoutput Alex or ASD, which means the winnerSample input
23 43 2
Sample output
Alexasd
In addition to Alex had to win, just once can win, or k=1, have no choice, can only once take, round him win, others are ASD win (after all, Alex Love ASD,
#include <iostream>#include<cstdio>using namespacestd;intMain () {intT, N, K; CIN>>T; while(t--) {cin>> N >>K; if(N <=k) printf ("alex\n"); Else if(k = =1) { if(n%2==0) printf ("asd\n"); Elseprintf ("alex\n"); } Elseprintf ("asd\n"); } return 0;}
If you think you can write it, you write it, and you have to read test instructions first.
Even if the topic is written like a lump, you have to find useful information in a lump inside ~ Seniors ' quotations
Similar questions: http://acm.zzuli.edu.cn/problem.php?cid=1099&pid=2 (should be similar to ~
Programmer's love affair