-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSP-He is offside.cpp
141 lines (88 loc) · 2.54 KB
/
SP-He is offside.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#include<bits/stdc++.h>
#include<cmath>
#include<cstdlib> //for qsort
#include<cstdio>
#define rep(x,a,b) for(x=a;x<b;x++)
#define reptill(x,a,b) for(x=a;x<=b;x++)
#define scani(x) scanf("%d",&x)
#define scan2i(x,y) scanf("%d %d",&x,&y)
#define scan3i(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define scanfl(x) scanf("%f",&x)
#define scanc(x) scanf("%c",&x)
#define scand(x) scanf("%lf",&x)
#define scanll(x) scanf("%lli",&x)
#define scan2ll(x,y) scanf("%lli %lli",&x,&y)
#define scan3ll(x,y) scanf("%lli %lli %lli",&x,&y,&z);
#define scanl(x) scanf("%ld",&x)
#define scans(x) scanf("%s",x)
#define printi(x) printf("%d\n",x)
#define printl(x) printf("%ld\n",x)
#define printll(x) printf("%lli\n",x)
#define printd(x) printf("%lf\n",x)
#define printfl(x) printf("%f\n",x)
#define printc(x) printf("%c\n",x)
#define prints(x) printf("%s\n",x);
#define sloop(x) loop(i,0,strlen(x)-1)
#define whole(x) x.begin(),x.end()
#define pb push_back
#define newline cout<<"\n"
#define F first
#define S second
#define FILL(A,value) memset(A,value,sizeof(A))
inline bool inc_range(int x,int y,int z) { return ((x>=y)&&(x<=z)); }
inline bool ex_range(int x,int y,int z) { return ((x>y)&&(x<z)); }
inline bool is_either(int x,int y,int z) { return ((x==y)||(x==z)); }
//maths
#define PI acos(-1)
#define INTmax numeric_limits<int>::max()
#define LLmax numeric_limits<ll>::max()
#define ULLmax numeric_limits<ull>::max()
#define INTmin numeric_limits<int>::min()
using namespace std;
template<typename type=int>
void get_arr(type a[],type n) {for(type i=0;i<n;i++) cin>>a[i];}
template<typename type=int>
void show_arr(type a[],type n=1) {for(type i=0;i<n;i++) cout<<a[i]<<" ";}
template<typename type=int>
inline type max3(type a,type b,type c){ return max(max(a,b),c);}
inline void FAST_IO(){ios_base::sync_with_stdio(false);}
#define SIZE int(1e3)+1
#define MOD
#define debug
//#define Online_judge
int ara[SIZE],ard[SIZE];
int main()
{
ifstream cin("ip");
while(true)
{
int a,d,i,j;
cin>>a>>d;
if(!a or !d)
break;
rep(i,0,a)
cin>>ara[i];
rep(i,0,d)
cin>>ard[i];
bool ans=false;
sort(ard,ard+d);
// cout<<"After sorting \n";
//rep(i,0,d)
// cout<<ard[i]<<" ";
//newline;
rep(i,0,a)
{
if(ara[i]<ard[1]){
ans=true;
// cout<<"Yes got for "<<ara[i]<<" "<<ard[2]<<endl;
break;
}
}
if(ans)
cout<<"Y\n";
else cout<<"N\n";
}
}