# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
685203 | DeEbOo | ACM (COCI19_acm) | C++17 | 2 ms | 980 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ppb pop_back()
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define yeah ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cans cout << ans << "\n";
using namespace std;
int main()
{
yeah
ll n , m;
cin >> n >> m;
string a[n + 1][m + 1];
for(int i = 0 ; n >= i ; i++)
for(int j = 0 ; m >= j ; j++)
cin >> a[i][j];
ll ans = n;
pair<int , pair<int , string>> team;
team.first = 0;
team.second.first = 0;
team.second.second = "NijeZivotJedanACM";
for(int i = 1 ; m >= i ; i++)
{
if(a[n][i][0] == '+')
{
team.first++;
team.second.first += int(a[n][i][1] - '0') * 1200;
ll ho = int(a[n][i][3] - '0') * 10 + int(a[n][i][4] - '0');
ll mi = int(a[n][i][6] - '0') * 10 + int(a[n][i][7] - '0');
ll se = int(a[n][i][9] - '0') * 10 + int(a[n][i][10] - '0');
team.second.first += (ho * 3600) + (mi * 60) + se;
}
}
for(int i = 0 ; n > i ; i++)
{
if(a[i][0] == "NijeZivotJedanACM")
continue;
ll x = 0;
ll y = 0;
for(int j = 1 ; m >= j ; j++)
{
if(a[i][j][0] == '+' || a[i][j][0] == '?')
{
x++;
y += int(a[i][j][1] - '0') * 1200;
ll ho = int(a[i][j][3] - '0') * 10 + int(a[i][j][4] - '0');
ll mi = int(a[i][j][6] - '0') * 10 + int(a[i][j][7] - '0');
ll se = int(a[i][j][9] - '0') * 10 + int(a[i][j][10] - '0');
y += (ho * 3600) + (mi * 60) + se;
}
}
//cout << x << " " << y << " " << team.first << " " << team.second.first << "\n";
if((x < team.first) || (x == team.first && y > team.second.first) || (x == team.first && y == team.second.first && a[i][0] > team.second.second))
ans--;
}
cans
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |