-
Notifications
You must be signed in to change notification settings - Fork 2
/
Test 1.cpp
69 lines (69 loc) · 1.14 KB
/
Test 1.cpp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
/* Read input from STDIN. Print your output to STDOUT*/
#include<bits/stdc++.h>
using namespace std;
int main(int argc, char *a[])
{
//Write code here
int T,N,i,j,k,x,temp;
cin>>T;
while(T--)
{
int flag=0;
cin>>N;
int E[N],P[N];
for(i=0;i<N;i++)
{
cin>>E[i];
}
for(j=0;j<N;j++)
{
cin>>P[j];
}
for(i=0;i<N;i++)
{
for(k=i+1;k<N;k++)
{
if(E[i]<E[k])
{
temp=E[i];
E[i]=E[k];
E[k]=temp;
}
}
}
/*for(i=0;i<N;i++)
cout<<E[i]<<"\t";*/
for(j=0;j<N;j++)
{
for(x=j+1;x<N;x++)
{
if(P[j]<P[x])
{
temp=P[j];
P[j]=P[x];
P[x]=temp;
}
}
}
/*for(j=0;j<N;j++)
cout<<P[j]<<"\t";*/
for(i=0;i<N;i++)
{
if(P[i]>E[i])
{
flag++;
//cout<<flag<<endl;
}
//cout<<flag<<endl;
}
//cout<<flag<<endl;
if(flag==N)
{
cout<<"WIN\n";
}
else
{
cout<<"LOSE\n";
}
}
}