# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
223371 | maomao90 | ACM (COCI19_acm) | C++14 | 10 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
typedef tuple <int, int, string> iis;
int N, M;
vector <iis> standings;
bool comp(iis right, iis left)
{
int rSolve, rTime, lSolve, lTime; string rName, lName;
tie(rSolve, rTime, rName) = right; tie(lSolve, lTime, lName) = left;
if (rSolve > lSolve) return true;
else if (rSolve == lSolve)
{
if (rTime < lTime) return true;
else if (rTime == lTime)
{
if (rName.compare(lName) < 0) return true;
}
}
return false;
}
int main()
{
scanf("%d%d", &N, &M);
for (int i = 0; i <= N; i++)
{
char temp[25]; scanf(" %s", temp);
string name = temp;
int penaltyTime = 0, solved = 0;
for (int i = 0; i < M; i++)
{
char sxv[20]; scanf(" %s", sxv);
char s = sxv[0];
if (s == '-')
{
continue;
}
else
{
solved++;
int attempts = sxv[1] - '0';
penaltyTime += (attempts - 1) * (20 * 60);
int hours = (sxv[3] - '0') * 10 + (sxv[4] - '0'),
minutes = (sxv[6] - '0') * 10 + (sxv[7] - '0'),
seconds = (sxv[9] - '0') * 10 + (sxv[10] - '0');
penaltyTime += seconds + minutes * 60 + hours * 60 * 60;
}
}
if (name == "NijeZivotJedanACM" && i != N) continue;
else
{
standings.emplace_back(solved, penaltyTime, name);
}
}
sort(standings.begin(), standings.end(), comp);
for (int i = 0; i < N; i++)
{
if (get<2>(standings[i]) == "NijeZivotJedanACM")
{
printf("%d\n", i + 1);
return 0;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |