# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222353 | oolimry | ACM (COCI19_acm) | C++14 | 8 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
struct thonk{
int AC;
long long penalty;
string name;
};
bool comp(thonk a, thonk b){
if(a.AC != b.AC) return a.AC > b.AC;
else if(a.penalty != b.penalty) return a.penalty < b.penalty;
else return a.name < b.name;
}
///.-.
int main(){
//freopen("i.txt","r",stdin);
ios_base::sync_with_stdio(false);
int n, m; cin >> n >> m;
string me = "NijeZivotJedanACM";
string meme = me;
vector<thonk> why;
for(int i = 0;i <= n;i++){
string team; cin >> team;
if(team == me){
me = "-1";
for(int i = 0;i < m;i++){
string s; cin >> s;
}
continue;
}
long long penalty = 0;
int AC = 0;
for(int i = 0;i < m;i++){
string s; cin >> s;
if(s.size() <= 2) continue;
AC++;
long long WA = s[1] - '1';
long long hour = (s[3] - '0') * 10 + (s[4] - '0');
long long minute = (s[6] - '0') * 10 + (s[7] - '0');
long long second = (s[9] - '0') * 10 + (s[10] - '0');
penalty += WA * 60 * 20 + hour * 60 * 60 + minute * 60 + second;
//cout << WA << " " << hour << " " << minute << " " << second << "|";
}
why.push_back({AC,penalty,team});
//cout << team << " " << AC << " " << penalty << "\n";
}
sort(why.begin(),why.end(),comp);
for(int i = 0;i< (int)why.size();i++){
//cout << why[i].AC << " " << why[i].name <<"\n";
if(why[i].name == meme){
cout << i+1;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |