Submission #711593

#TimeUsernameProblemLanguageResultExecution timeMemory
711593becaidoACM (COCI19_acm)C++17
50 / 50
2 ms468 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,popcnt,sse4,abm") #include <bits/stdc++.h> using namespace std; #ifdef WAIMAI #define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE) void dout() {cout << '\n';} template<typename T, typename...U> void dout(T t, U...u) {cout << t << (sizeof... (u) ? ", " : ""), dout (u...);} #else #define debug(...) 7122 #endif #define ll long long #define Waimai ios::sync_with_stdio(false), cin.tie(0) #define FOR(x,a,b) for (int x = a, I = b; x <= I; x++) #define pb emplace_back #define F first #define S second const int SIZE = 1005; int n, m; struct ds { string name; int ac, penalty; bool operator < (const ds& rhs) const { return ac != rhs.ac ? ac > rhs.ac : penalty != rhs.penalty ? penalty < rhs.penalty : name < rhs.name; } } a[SIZE]; int num(string s) { int re = 0; for (char c : s) re = 10 * re + c - '0'; return re; } pair<int, int> result() { int ac = 0, penalty = 0; FOR (i, 1, m) { string s; cin >> s; if (s[0] == '-') continue; ac++; penalty += (s[1] - '1') * 1200 + 3600 * num(s.substr(3, 2)) + 60 * num(s.substr(6, 2)) + num(s.substr(9, 2)); } return {ac, penalty}; } void solve() { cin >> n >> m; FOR (i, 1, n) { cin >> a[i].name; tie(a[i].ac, a[i].penalty) = result(); } string s; cin >> s; FOR (i, 1, n) if (a[i].name == s) tie(a[i].ac, a[i].penalty) = result(); sort(a + 1, a + n + 1); FOR (i, 1, n) if (a[i].name == s) { cout << i << '\n'; return; } } int main() { Waimai; solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...