Submission #8998

# Submission time Handle Problem Language Result Execution time Memory
8998 2014-09-27T10:22:56 Z mrcamel Penalty calculation (kriii2_PE) C++
4 / 4
0 ms 1672 KB
#include <cstdio>
#include <iostream>
#include <fstream>
#include <deque>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>
#include <queue>
using namespace std;

#define in cin
#define out cout
#define PII pair<int, int>
#define x first
#define y second
#define REP(i, s, e) for(int i=s; i<=e; i++)

struct aaa
{
    int idx, time, score;
};

int main()
{
    //freopen("in.txt", "r", stdin);

    int n; in >> n;
    aaa arr[111];

    int maxn = -1, maxi = -1;
    REP(i, 1, n)
    {
        arr[i].idx = i;
        in >> arr[i].time >> arr[i].score;

        if( arr[i].score > maxn ) {maxn = arr[i].score; maxi = i;}
    }

    if( arr[maxi].score == 0 )
        out << 0 << endl;
    else
        out << arr[maxi].time + (arr[maxi].idx-1)*20;

    return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 1672 KB Output is correct
2 Correct 0 ms 1672 KB Output is correct
3 Correct 0 ms 1672 KB Output is correct
4 Correct 0 ms 1672 KB Output is correct
5 Correct 0 ms 1672 KB Output is correct
6 Correct 0 ms 1672 KB Output is correct
7 Correct 0 ms 1672 KB Output is correct
8 Correct 0 ms 1672 KB Output is correct
9 Correct 0 ms 1672 KB Output is correct
10 Correct 0 ms 1672 KB Output is correct
11 Correct 0 ms 1672 KB Output is correct
12 Correct 0 ms 1672 KB Output is correct
13 Correct 0 ms 1672 KB Output is correct
14 Correct 0 ms 1672 KB Output is correct
15 Correct 0 ms 1672 KB Output is correct
16 Correct 0 ms 1672 KB Output is correct
17 Correct 0 ms 1672 KB Output is correct
18 Correct 0 ms 1672 KB Output is correct
19 Correct 0 ms 1672 KB Output is correct
20 Correct 0 ms 1672 KB Output is correct
21 Correct 0 ms 1672 KB Output is correct
22 Correct 0 ms 1672 KB Output is correct
23 Correct 0 ms 1672 KB Output is correct
24 Correct 0 ms 1672 KB Output is correct
25 Correct 0 ms 1672 KB Output is correct
26 Correct 0 ms 1672 KB Output is correct
27 Correct 0 ms 1672 KB Output is correct
28 Correct 0 ms 1672 KB Output is correct
29 Correct 0 ms 1672 KB Output is correct
30 Correct 0 ms 1672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1672 KB Output is correct
2 Correct 0 ms 1672 KB Output is correct
3 Correct 0 ms 1672 KB Output is correct
4 Correct 0 ms 1672 KB Output is correct
5 Correct 0 ms 1672 KB Output is correct
6 Correct 0 ms 1672 KB Output is correct
7 Correct 0 ms 1672 KB Output is correct
8 Correct 0 ms 1672 KB Output is correct
9 Correct 0 ms 1672 KB Output is correct
10 Correct 0 ms 1672 KB Output is correct
11 Correct 0 ms 1672 KB Output is correct
12 Correct 0 ms 1672 KB Output is correct
13 Correct 0 ms 1672 KB Output is correct
14 Correct 0 ms 1672 KB Output is correct
15 Correct 0 ms 1672 KB Output is correct
16 Correct 0 ms 1672 KB Output is correct
17 Correct 0 ms 1672 KB Output is correct
18 Correct 0 ms 1672 KB Output is correct
19 Correct 0 ms 1672 KB Output is correct
20 Correct 0 ms 1672 KB Output is correct
21 Correct 0 ms 1672 KB Output is correct
22 Correct 0 ms 1672 KB Output is correct
23 Correct 0 ms 1672 KB Output is correct
24 Correct 0 ms 1672 KB Output is correct
25 Correct 0 ms 1672 KB Output is correct
26 Correct 0 ms 1672 KB Output is correct
27 Correct 0 ms 1672 KB Output is correct
28 Correct 0 ms 1672 KB Output is correct
29 Correct 0 ms 1672 KB Output is correct
30 Correct 0 ms 1672 KB Output is correct