Submission #685203

#TimeUsernameProblemLanguageResultExecution timeMemory
685203DeEbOoACM (COCI19_acm)C++17
50 / 50
2 ms980 KiB
#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 timeMemoryGrader output
Fetching results...