#include <algorithm>
#include <cstdio>
struct ProblemInfo {
int t;
int s;
int p_number;
};
ProblemInfo p[100];
bool cmp(const ProblemInfo& a, const ProblemInfo& b) {
return a.s > b.s;
}
int main() {
int num_of_solutions = 0;
scanf(" %d", &num_of_solutions);
for (int i = 0; i < num_of_solutions; ++i) {
scanf(" %d %d", &p[i].t, &p[i].s);
p[i].p_number = i + 1;
}
std::sort(p, p + num_of_solutions, cmp);
int f = p[0].p_number;
if (p[0].s == 0) {
printf("0\n");
}
else if (p[0].s == 1 || p[0].s == 4) {
printf("%d", p[0].t + (f - 1) * 20);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |