제출 #592935

#제출 시각아이디문제언어결과실행 시간메모리
592935MahtimursuPoi (IOI09_poi)C++17
100 / 100
209 ms9632 KiB
#include <bits/stdc++.h> typedef long long ll; #define M 1000000007 #define N (1 << 18) using namespace std; int score[2001]; vector<int> solved[2001]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, t, p; cin >> n >> t >> p; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= t; ++j) { int x; cin >> x; if (x == 0) score[j]++; else solved[i].push_back(j); } } vector<pair<int, pair<int, int>>> v; for (int i = 1; i <= n; ++i) { int sc = 0; for (int x : solved[i]) sc += score[x]; v.push_back({sc, {solved[i].size(), -i}}); } sort(v.rbegin(), v.rend()); for (int i = 0; i < n; ++i) { if (v[i].second.second == -p) { cout << v[i].first << " " << i + 1 << "\n"; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...