# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1193948 | SmuggingSpun | ACM (COCI19_acm) | C++20 | 1 ms | 400 KiB |
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
struct Data{
string name;
int cnt, time;
Data(){
this->cnt = this->time = 0;
}
Data(string _name, int _cnt, int _time) : name(_name), cnt(_cnt), time(_time) {}
bool operator <(const Data& other){
return this->cnt > other.cnt || (this->cnt == other.cnt && this->time < other.time) || (this->cnt == other.cnt && this->time == other.time && this->name < other.name);
}
};
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
int n, m;
cin >> n >> m;
vector<Data>a(n + 1);
for(auto& [name, cnt, time] : a){
cin >> name;
for(int i = 0; i < m; i++){
string s;
cin >> s;
if(s[0] != '-'){
if(name != "NijeZivotJedanACM" || s[0] == '+'){
cnt++;
time += (s[1] - 48) * 1200 + (s[4] - 48) * 3600 + ((s[6] - 48) * 10 + s[7]) * 60 + (s[9] - 48) * 10 + s[10] - 48;
}
}
}
}
sort(a.begin(), a.end());
for(int i = 0; i < n; i++){
if(a[i].name == "NijeZivotJedanACM"){
return cout << i + 1, 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |