-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwin.c
More file actions
56 lines (56 loc) · 1.17 KB
/
win.c
File metadata and controls
56 lines (56 loc) · 1.17 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Read input from STDIN. Print your output to STDOUT*/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include<algorithm>
#include <limits.h>
#include <stdbool.h>
using namespace std;
int main(int argc, char *a[])
{
int T,N,temp,i,j,x,flag=0;
long long int strength[N],energy[N];
cin>>T;
for(x=0;x<T;x++)
{
cin>>N;
for(i=0;i<N;i++)
cin>>energy[i];
for(j=0;j<N;j++)
cin>>strength[j];
for(i=0; i<N; i++)
for(j=i+1; j<N; j++)
if(strength[i] > strength[j])
{
temp = strength[i];
strength[i] = strength[j];
strength[j] = temp;
}
for(i=0; i<N; i++)
for(j=i+1; j<N; j++)
if(energy[i] > energy[j])
{
temp = energy[i];
energy[i] = energy[j];
energy[j] = temp;
}
for(i=0;i<N;i++)
if(energy[i]<strength[i])
flag=0;
else
flag=1;
if(flag=0)
{
printf("LOSE\n");
cout<<"";
}
else
{
printf("WIN\n");
cout<<"";
}
}
}