Skip to content

Instantly share code, notes, and snippets.

@ylogx
Created October 7, 2013 23:20
Show Gist options
  • Save ylogx/6876706 to your computer and use it in GitHub Desktop.
Save ylogx/6876706 to your computer and use it in GitHub Desktop.
psmapa.c - Aspiration 2020 Contest Problem
/*
* foobar - Shubham Chaudhary
* Nitul Datt
*/
#include <stdio.h>
#include <stdlib.h>
int fastread()
{
unsigned int input;
char c=0;
while (c<33){
c=getchar_unlocked();
//printf("\nWHILE: c is %c",c);
}
input=0;
while (c>33)
{
//printf("\nWHILE 2 : c is %c",c);
input=input*10+c-'0';
//printf("\n%d * 10 + %d - %d",input,c,'0');
c=getchar_unlocked();
}
//printf("\nInput is : %d",input);
return input;
}
int main(){
//foobar
int m;
int i;
m=fastread();//scanf("%d",&m);
for(i=0;i<m;i++){
int no;
no=fastread();//scanf("%d",&no);
if(no%2==0){
printf("%d won\n",i+1);
}else{
printf("%d lost\n",i+1);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment