이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int, int> PAIR;
bool cmp(PAIR a, PAIR b) {
return a.second > b.second;
}
int stamp[301];
int main(void) {
int T;
vector<PAIR> set;
cin >> T;
for (int i = 0; i < T; i++) {
int t, s;
cin >> t >> s;
stamp[t] = i + 1;
set.push_back(PAIR(t, s));
}
sort(set.begin(), set.end(), cmp);
int tf = set[0].first;
int sf = set[0].second;
int p ;
if (sf == 0) {
p = 0;
}
else if (sf == 1 || sf == 4) {
p = tf + (stamp[tf] - 1) * 20;
}
cout << p << endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |