Olympics Ranking|Codechef Coding Problems

Input Format

Output Format

Constraints

Subtasks

Sample Input 1

3
10 20 30 0 29 30
0 0 0 0 0 1
1 1 1 0 0 0

Sample Output 1

1
2
1

Explanation

/* author : @akash */#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mod 1000000007
#define ld long double
void solve()
{
int G1,S1,B1;
int G2,S2,B2;
cin>>G1>>S1>>B1>>G2>>S2>>B2;
if(G1+S1+B1>G2+S2+B2)
{
cout<<1;
}
else
{
cout<<2;
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
solve();
cout<<"\n";
}
return 0;
}
// time complexity of this algorithm is : T(n)=O(1)

--

--

--

Student of Computer Science & Engineering at Moradabad Institute of Technology.

Love podcasts or audiobooks? Learn on the go with our new app.

WordPress And Database Setup Using Google Cloud Services Kubernetes Engine And SQL

Live-debugging Nim in a Game Engine

Export PLSQL table to Pandas dataFrame & CSV using Python

How to make your website rank 100% on its Accessibility

When to use Java Enums

Implementing Pub/Sub Pattern in Rust With Redis Publish

Dependency Injection and Inversion of Control in Brief

Airnode: The API gateway for blockchains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akash Kumar

Akash Kumar

Student of Computer Science & Engineering at Moradabad Institute of Technology.

More from Medium

Before You Graduate! For Every Computer Science Student

What are Coursera and its feature?

Using Dynamic Programming for Dyslexia — Automatic Spelling Mistakes Diagnosis

Women Who Code Delhi Mentorship Program 4.0: Week 1