제출 #698119

#제출 시각아이디문제언어결과실행 시간메모리
698119europiumPoi (IOI09_poi)C++17
0 / 100
244 ms23856 KiB
// - 12/2/23 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <numeric> #include <cmath> #include <iterator> #include <set> #include <map> #include <math.h> #include <iomanip> #include <unordered_set> #include <queue> #include <climits> using namespace std; // clang++ -std=c++17 IOI09_POI.cpp && ./a.out using ll = long long; void solve(){ int n, t, p; cin >> n >> t >> p; vector<int> score(t); vector<vector<int>> c (n, vector<int>(t)); for (int i = 0; i < n; i++){ for (int j = 0; j < t; j++){ cin >> c[i][j]; if (c[i][j] == 0) score[j]++; } } vector<tuple<int,int,int>> rank; // score, tasks solved, ID; for (int i = 0; i < n; i++){ int s = 0, solved = 0; for (int j = 0; j < t; j++){ if (c[i][j] == 1){ s += score[j]; solved++; } } rank.push_back({s, solved, i + 1}); } sort(rank.begin(), rank.end()); int cnt = 0; for (auto [s, solved, id] : rank){ cnt++; if (id == p){ cout << s << ' ' << cnt << '\n'; return; } } } int main() { ios::sync_with_stdio(false); cin.tie(0); // freopen("input.txt", "r", stdin); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...