Skip to content

Commit 5386938

Browse files
authored
Add English editorial for the problem LOJ-1509 (#426)
* Adding a new editorial for the problem LOJ-1509 * Rename LOJ-1509/en.md to 1509/en.md * Update en.md
1 parent dad33d9 commit 5386938

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

1509/en.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# LOJ 1509 - ICPC Standing
2+
3+
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.
4+
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.
5+
6+
7+
### Approach:
8+
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.
9+
10+
If you are still stuck with this problem, check the code below:
11+
12+
### C++
13+
```cpp
14+
#include <bits/stdc++.h>
15+
using namespace std;
16+
int main()
17+
{
18+
int t;
19+
cin >> t;
20+
for (int k = 1; k <= t; k++)
21+
{
22+
int p, s, r;
23+
cin >> p >> s >> r;
24+
cout << "Case " << k << ": ";
25+
if (p == s and r != 1)
26+
{
27+
cout << "No" << endl;
28+
}
29+
else
30+
{
31+
cout << "Yes" << endl;
32+
}
33+
}
34+
}
35+
```

0 commit comments

Comments
 (0)