제출 #480172

#제출 시각아이디문제언어결과실행 시간메모리
480172gg123_pePoi (IOI09_poi)C++17
0 / 100
685 ms23816 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 << v[i].first << " " << i+1 << endl; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...