# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
222361 | cheeheng | ACM (COCI19_acm) | C++14 | 6 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |