Submission #893080

#TimeUsernameProblemLanguageResultExecution timeMemory
893080MackerPoi (IOI09_poi)C++17
100 / 100
181 ms8904 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define all(v) v.begin(), v.end() //#pragma GCC optimize("Ofast") //#pragma GCC target("avx2") int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, p, o; cin >> n >> p >> o; o--; vector<vector<bool>> c(n, vector<bool>(p)); vector<int> t(p); vector<tuple<int, int, int>> res(n); for (int i = 0; i < n; i++) { get<2>(res[i]) = i; for (int j = 0; j < p; j++) { int a; cin >> a; if(a == 0){ t[j]++; } else{ get<1>(res[i])--; } c[i][j] = a; } } for (int i = 0; i < n; i++) { for (int j = 0; j < p; j++) { get<0>(res[i]) -= c[i][j] * t[j]; } } sort(all(res)); for (int i = 0; i < n; i++) { if(get<2>(res[i]) == o){ cout << -get<0>(res[i]) << " " << i + 1 << "\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...