# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
222362 | dwsc | ACM (COCI19_acm) | C++14 | 71 ms | 896 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<string,vector<string>> vs;
typedef pair<int,int> ii;
string target ="NijeZivotJedanACM";
vs actual;
ii score(vs team){
vector<string> use;
ii val = ii(0,0);
if (team.first == target){
use = actual.second;
for (int i = 0; i < use.size(); i++){
string sub = use[i];
if (sub[0] == '+'){
val.first++;
int slash = -1;
string subtime = "";
for (int j = 3; j < sub.length(); j++){
subtime += sub[j];
}
val.second -= (sub[1]-48-1)*1200;
val.second -= (((subtime[1]-48)*3600)+((subtime[3]-48)*600)+((subtime[4]-48)*60)+((subtime[6]-48)*10)+(subtime[7]-48));
}
}
}
else{
use = team.second;
for (int i = 0; i < use.size(); i++){
string sub = use[i];
if (sub[0] == '+' || sub[0] == '?'){
val.first++;
int slash = -1;
string subtime = "";
for (int j = 3; j < sub.length(); j++){
subtime += sub[j];
}
val.second -= (sub[1]-48-1)*1200;
val.second -= (((subtime[1]-48)*3600)+((subtime[3]-48)*600)+((subtime[4]-48)*60)+((subtime[6]-48)*10)+(subtime[7]-48));
}
}
}
return val;
}
bool cmp(vs team1,vs team2){
ii s1 = score(team1),s2 = score(team2);
if (s1 > s2) return 1;
if (s2 > s1) return 0;
return (team1.first < team2.first);
}
int main(){
int n,m;
cin >> n >> m;
vs arr[n];
for (int i = 0; i < n; i++){
string name;
cin >> name;
vector<string> subs;
for (int j = 0; j < m; j++){
string sub;
cin >> sub;
subs.push_back(sub);
}
arr[i] = vs(name,subs);
}
string name;
cin >> name;
vector<string> subs;
for (int i = 0; i < m; i++){
string sub;
cin >> sub;
subs.push_back(sub);
}
actual = vs(name,subs);
sort(arr,arr+n,cmp);
for (int i = 0; i < n; i++) if (arr[i].first == target) cout << i+1;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |