제출 #631643

#제출 시각아이디문제언어결과실행 시간메모리
631643PolishFighterPoi (IOI09_poi)C++17
70 / 100
286 ms4168 KiB
#include<bits/stdc++.h> using namespace std; constexpr int MAXN = 2e3 + 10; int points[MAXN]; bool contestants[MAXN][MAXN]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, t, p; cin >> n >> t >> p; p--; for(int i = 0; i < n; i++) { for(int j = 0; j < t; j++) { cin >> contestants[i][j]; if(contestants[i][j] == 0) { points[j]++; } } } int philips_p = 0; int philips_t = 0; for(int i= 0; i < t; i++) { if(contestants[p][i] == 1) { philips_t++; philips_p += points[i]; } } int philips_r = 1; int points2; int t2; for(int i = 0; i < n ; i++) { if(i == p) continue; t2 = 0; points2 = 0; for(int j = 0; j < t; j++) { if(contestants[i][j] == 1) { t2++; points2 += points[j]; } } if(points2 > philips_p || (points2 == philips_p && (i < p || t2 > philips_t))) { philips_r++; } } cout << philips_p << " " << philips_r << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...