Skip to content

Adding a new editorial for the problem LOJ-1509 #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions 1509/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# LOJ 1509 - ICPC Standing

In this problem, you will be given `T` testcases. The first line of each test case contains three integers `P` ,`S` and `R` where `P` denotes the number of problems in the problem set, `S` denotes the number of solved problems by the current team and `R` denotes the rank of the current team.
Now, in the problems statement it was asked if there was a chance for the current team to become champion after the end of the contest.


### Approach:
This is a very simple adhoc problem.The current team will only not be able to become the champion of the contest if they have solved all the problems that are in the problem statement and still couldn't achieve the first position.Other than this there is always a chance for the current team to become champion after the end of the contest.

If you are still stuck with this problem, check the code below:

### C++
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
for (int k = 1; k <= t; k++)
{
int p, s, r;
cin >> p >> s >> r;
cout << "Case " << k << ": ";
if (p == s and r != 1)
{
cout << "No" << endl;
}
else
{
cout << "Yes" << endl;
}
}
}
```