Programmer's love affair

Source: Internet
Author: User

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

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: (should be similar to ~

Programmer's love affair

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.