Submission #758501

#TimeUsernameProblemLanguageResultExecution timeMemory
758501JANCARAPANPoi (IOI09_poi)C++17
100 / 100
228 ms23860 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define fi first #define se second #define sz(a) (long long) a.size() #define endl '\n' const long long INF = 1e18, MOD = 1e9+7; void test_case() { int n, t, p; cin >> n >> t >> p; p--; vector<array<int,3>> scores(n); vector<int> unsolved(t, n); vector a(n, vector<int>(t)); for (int i = 0; i < n; i++) { for (int j = 0; j < t; j++) { cin >> a[i][j]; unsolved[j] -= a[i][j]; } } for (int i = 0; i < n; i++) { scores[i][2] = n - i -1; for (int j = 0; j < t; j++) { if (a[i][j]) { scores[i][0] += unsolved[j]; scores[i][1]++; } } } cout << scores[p][0] << " "; sort(scores.rbegin(), scores.rend()); for (int i = 0; i < n; i++) { if (n - p - 1 == scores[i][2]) { cout << i + 1 << endl; } } } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); int tt = 1; //cin >> tt; while (tt--) { test_case(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...