Submission #991039

#TimeUsernameProblemLanguageResultExecution timeMemory
991039SoSmolStenPoi (IOI09_poi)C++17
5 / 100
178 ms12160 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e3 + 10; ll score[N]; bool f[N][N]; int main (int argc, char const *argv[]) { ios_base::sync_with_stdio(0); cin.tie(0); int n, t, p; cin >> n >> t >> p; for(int i = 1; i <= t; ++i) score[i] = n; for(int i = 1; i <= n; ++i){ for(int j = 1; j <= t; ++j){ cin >> f[i][j]; score[j] -= f[i][j]; } } vector<pair<int, int>> scoreboard; for(int i = 1; i <= n; ++i){ int sum = 0; for(int j = 1; j <= t; ++j){ sum += f[i][j] * score[j]; } scoreboard.push_back({sum, i}); } sort(scoreboard.begin(), scoreboard.end()); for(int i = 0; i < n; ++i){ if(scoreboard[i].second == p){ cout << scoreboard[i].first << ' ' << i + 1; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...