제출 #8949

#제출 시각아이디문제언어결과실행 시간메모리
8949model_codePenalty calculation (kriii2_PE)C++98
1 / 4
0 ms1088 KiB
#define _CRT_SECURE_NO_WARNINGS
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <deque>
#include <utility>
#include <bitset>
#include <limits.h>
  
using namespace std;
typedef long long ll;
typedef double lf;
typedef long double llf;
typedef unsigned long long llu;
 
int cnt[10], tm[10];
 
int main(int argc, char * argv[]) {
    int n;
 
    scanf("%d", &n);
 
    int maxs = -1;
    for(int i = 1; i <= n; i++) {
        int t, s; scanf("%d%d", &t, &s);
        maxs = max(maxs, s);
        if(!cnt[s]) cnt[s] = i, tm[s] = t;
    }
 
    if(maxs > 0)
        printf("%d\n", tm[4] + (cnt[4] - 1) * 20);
    else
        puts("0");
 
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...