# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
495854 | AlperenT | ACM (COCI19_acm) | C++17 | 4 ms | 508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
int n, m, indx;
string str;
struct Team{
string name;
int solved, penalty;
bool operator < (const Team &scnd) const{
if(solved != scnd.solved) return solved > scnd.solved;
else{
if(penalty != scnd.penalty) return penalty < scnd.penalty;
else return name < scnd.name;
}
}
};
Team teams[N];
int timetoint(string str){
int secs = 0;
secs += stoi(str.substr(0, 2)) * 3600;
secs += stoi(str.substr(3, 2)) * 60;
secs += stoi(str.substr(6, 2));
return secs;
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
cin >> n >> m;
indx = 1;
for(int i = 1; i <= n; i++){
cin >> teams[indx].name;
if(teams[indx].name != "NijeZivotJedanACM"){
for(int j = 0; j < m; j++){
cin >> str;
if(str[0] == '+' || str[0] == '?'){
teams[indx].solved++;
teams[indx].penalty += (str[1] - '0' - 1) * 1200 + timetoint(str.substr(3, 8));
}
}
indx++;
}
else{
for(int i = 0; i < m; i++) cin >> str;
}
}
cin >> teams[n].name;
for(int j = 0; j < m; j++){
cin >> str;
if(str[0] == '+' || str[0] == '?'){
teams[n].solved++;
teams[n].penalty += (str[1] - '0' - 1) * 1200 + timetoint(str.substr(3, 8));
}
}
sort(teams + 1, teams + n + 1);
for(int i = 1; i <= n; i++) if(teams[i].name == "NijeZivotJedanACM") cout << i;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |