| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 222348 | dantoh000 | ACM (COCI19_acm) | C++14 | 19 ms | 768 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
unordered_map<string,int> score;
unordered_map<string,int> penalty;
string names[1005];
int time(string s){
int h = 0, m = 0, S = 0;
h = s[0]*10 + s[1];
m = s[3]*10 + s[4];
S = s[5]*10 + s[6];
return h*60*60 + m*60 + S;
}
int process(string name, string s){
//cout << name << " " << s << endl;
if (s[0] == '-') return 0;
if (s[0] == '+' || s[0] == '?'){
score[name]++;
int num = s[1];
penalty[name] += num*20*60;
string k = "";
for (int i = 3; i < s.size(); i++) k += s[i];
int t = time(k);
penalty[name] += t;
}
}
bool compare(string a, string b){
if (score[a] == score[b]) return penalty[a] < penalty[b];
else return score[a] > score[b];
}
int main(){
int n,m;
scanf("%d%d",&n,&m);
for (int i = 0; i < n; i++){
string name;
cin >> name;
names[i] = name;
for (int j = 0; j < m; j++){
string s;
cin >> s;
process(name,s);
}
}
string name;
cin >> name;
score[name] = 0;
penalty[name] = 0;
for (int j = 0; j < m; j++){
string s;
cin >> s;
process(name,s);
}
int ans = 1;
for (int i = 0; i < n; i++){
if (compare(names[i],name)) ans++;
}
printf("%d",ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
