# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
484016 | CSQ31 | ACM (COCI19_acm) | C++17 | 5 ms | 460 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;
typedef long long int ll;
#define fi first
#define se second
struct team{
string name;
ll ac = 0,pen = 0;
team(){}
};
bool cmp(const team &a,const team &b){
if(a.ac!=b.ac)return a.ac > b.ac;
if(a.pen!=b.pen)return a.pen < b.pen;
return a.name < b.name;
}
int main()
{
int n,m;
cin>>n>>m;
vector<team>fuck;
string ahhh = "NijeZivotJedanACM";
for(int i=0;i<=n;i++){
team f;
cin>>f.name;
for(int i=0;i<m;i++){
string s;
cin>>s;
if((int)(s.size())<=2)continue;
if(s[0] != '-'){
f.ac++;
//NijeZivotJedanACM ?1/04:42:43 -
f.pen += (s[1] - '1') * 60 * 20;
f.pen += (s[3] - '0') * 60 * 10 * 60;
f.pen += (s[4] - '0') * 60 * 60;
f.pen += (s[6] - '0') * 10 * 60;
f.pen += (s[7] - '0') * 60;
f.pen += (s[9] - '0') * 10;
f.pen += (s[10] - '0');
}
}
//cout<<f.ac<<" "<<f.pen<<'\n';
if(i!=n && f.name == ahhh)continue;
fuck.push_back(f);
}
sort(fuck.begin(),fuck.end(),cmp);
for(int i=0;i<n;i++){
if(fuck[i].name == ahhh){
cout<<i+1;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |