답안 #685203

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
685203 2023-01-23T17:02:43 Z DeEbOo ACM (COCI19_acm) C++17
50 / 50
2 ms 980 KB
#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
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 ms 956 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 980 KB Output is correct
5 Correct 2 ms 932 KB Output is correct