-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDCEPC_IndianConnection.cpp
More file actions
35 lines (33 loc) · 1.04 KB
/
DCEPC_IndianConnection.cpp
File metadata and controls
35 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<stdio.h>
char a[100];
int main(){
int t,n,k,top;
char ans;
scanf("%d",&t);
while(t--){
scanf("%d%d",&n,&k);
top=1;
k=k+(1<<(n))-1;
while(k>0){
if(k&1){
k=(k-1)/2;
a[top++]='R';
}
else{
k=k/2;
a[top++]='L';
}
}
top--;
ans='M';
for(int i=top-1;i>0;i--){
if(a[i]=='L'&&ans=='M')ans='M';
else if(a[i]=='L'&&ans=='F')ans='F';
else if(a[i]=='R'&&ans=='M')ans='F';
else ans='M';
}
if(ans=='M')printf("Male\n");
else if(ans=='F')printf("Female\n");
}
return 0;
}