Submission #8999

#TimeUsernameProblemLanguageResultExecution timeMemory
8999dolpang2Penalty calculation (kriii2_PE)C++98
0 / 4
0 ms1088 KiB
#include <algorithm> #include <cstdio> struct ProblemInfo { int t; int s; int p_number; }; bool cmp(const ProblemInfo& a, const ProblemInfo& b) { return a.s > b.s; } int main() { ProblemInfo p[100]; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...