# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222361 | cheeheng | ACM (COCI19_acm) | C++14 | 6 ms | 256 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 pair<int, int> ii;
char str[35];
char str2[35];
int main(){
int N, M;
scanf("%d%d", &N, &M);
int hero = -1;
vector<ii> scores;
int hero_solved = 0;
int hero_penalty = 0;
for(int i = 0; i <= N; i ++){
memset(str, 0, sizeof(str));
scanf(" %s", str);
int indx = i;
if(string(str) == "NijeZivotJedanACM"){
if(i < N){
hero = i;
for(int j = 0; j < M; j ++){
scanf(" %s", str2);
}
continue;
}else{
indx = hero;
}
}
int solved = 0;
int penalty = 0;
for(int j = 0; j < M; j ++){
memset(str2, 0, sizeof(str2));
scanf(" %s", str2);
if(str2[0] == '-'){
continue;
}else{
penalty += 1200*(str2[1]-'0') + 36000*(str2[3]-'0') + 3600*(str2[4]-'0')
+ 600*(str2[6]-'0') + 60*(str2[7]-'0') + 10*(str2[9]-'0') + (str2[10]-'0');
//printf("%c\n", str2[1]);
solved ++;
}
}
if(i == N){
hero_solved = solved;
hero_penalty = penalty;
}
//printf("%d %d\n", solved, penalty);
scores.push_back(ii(solved, -penalty));
}
sort(scores.begin(), scores.end());
reverse(scores.begin(), scores.end());
for(ii temp: scores){
//printf("Score: %d %d\n", temp.first, -temp.second);
}
int indx = 0;
for(int i = 0; i < (int)scores.size(); i ++){
if(scores[i] == ii(hero_solved, -hero_penalty)){
printf("%d", i+1);
return 0;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |