Submission #480173

#TimeUsernameProblemLanguageResultExecution timeMemory
480173gg123_pePoi (IOI09_poi)C++14
100 / 100
687 ms15972 KiB
#include <bits/stdc++.h> using namespace std; #define f(i,a,b) for(int i = a; i < b; i++) int n, t, p, grade[2005], a[2005][2005]; vector <pair<int,pair<int,int>>> v; int main(){ cin >> n >> t >> p; f(i,1,n+1) f(j,1,t+1) cin >> a[i][j]; f(i,1,t+1){ f(j,1,n+1) grade[i] += (a[j][i] == 0); } f(i,1,n+1){ int score = 0, c = 0; f(j,1,t+1) score += a[i][j]*grade[j], c += a[i][j]; v.push_back({-score, {-c, i}}); } sort(v.begin(), v.end()); f(i,0,n){ if(v[i].second.second == p){ cout << abs(v[i].first) << " " << i+1 << endl; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...