# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
991039 | SoSmolSten | Poi (IOI09_poi) | C++17 | 178 ms | 12160 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e3 + 10;
ll score[N];
bool f[N][N];
int main (int argc, char const *argv[]) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, t, p; cin >> n >> t >> p;
for(int i = 1; i <= t; ++i) score[i] = n;
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= t; ++j){
cin >> f[i][j];
score[j] -= f[i][j];
}
}
vector<pair<int, int>> scoreboard;
for(int i = 1; i <= n; ++i){
int sum = 0;
for(int j = 1; j <= t; ++j){
sum += f[i][j] * score[j];
}
scoreboard.push_back({sum, i});
}
sort(scoreboard.begin(), scoreboard.end());
for(int i = 0; i < n; ++i){
if(scoreboard[i].second == p){
cout << scoreboard[i].first << ' ' << i + 1;
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |