-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCC-RADGEE.cpp
More file actions
52 lines (47 loc) · 902 Bytes
/
CC-RADGEE.cpp
File metadata and controls
52 lines (47 loc) · 902 Bytes
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
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll t;
scanf("%lld",&t);
while(t--){
//r:radhesh's points, g: geethakomaare's points
ll n,m,r=0,g=0,counter=0,ri,gi;
scanf("%lld%lld",&n,&m);
vector <ll> R;
vector <ll> G;
ll M[m];
for(ll i=0;i<n;i++){
scanf("%lld",&ri);
R.push_back(ri);
}
for(ll i=0;i<n;i++){
scanf("%lld",&gi);
G.push_back(gi);
}
for(ll i=0;i<m;i++){
scanf("%lld",&M[i]);
}
// brute force logic
for(ll i=0;i<(m/2);i++){
if(R[i]>G[i]){
R.push_back(M[counter++]);
G.push_back(M[counter++]);
r++;
}else{
G.push_back(M[counter++]);
R.push_back(M[counter++]);
g++;
}
}
for(ll i=m/2;i<(n+m/2);i++){
if(R[i]>G[i]) r++;
else g++;
}
//results
if(r>g) printf("Radhesh wins\n");
else if(r<g) printf("Geethakoomaree wins\n");
else printf("Tie\n");
}
return 0;
}