# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
663289 |
2022-11-26T17:43:05 Z |
esomer |
Poi (IOI09_poi) |
C++17 |
|
285 ms |
16812 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int MOD = 1e9 + 7;
void solve(){
int n, t, p; cin >> n >> t >> p; p--;
vector<int> scores(t, n);
vector<vector<int>> v(n, vector<int>(t));
for(int i = 0; i < n; i++){
for(int j = 0; j < t; j++){
int x; cin >> x;
if(x == 1) scores[j]--;
v[i][j] = x;
}
}
vector<tuple<int, int, int>> res(n);
for(int i = 0; i < n; i++){
int score = 0;
int tasks = 0;
for(int j = 0; j < t; j++){
if(v[i][j]) {score += scores[j]; tasks++;}
}
res[i] = {score, tasks, i};
}
sort(res.begin(), res.end());
for(int i = 0; i < n; i++){
if(get<2>(res[i]) == p){
cout << get<0>(res[i]) << " "<< i + 1 << endl;
return;
}
}
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
//freopen("inpt.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
//int tt; cin >> tt;
int tt = 1;
for(int t = 1; t <= tt; t++){
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
316 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
320 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
320 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
468 KB |
Output isn't correct |
11 |
Incorrect |
8 ms |
972 KB |
Output isn't correct |
12 |
Incorrect |
17 ms |
1496 KB |
Output isn't correct |
13 |
Incorrect |
46 ms |
3540 KB |
Output isn't correct |
14 |
Incorrect |
63 ms |
4432 KB |
Output isn't correct |
15 |
Incorrect |
113 ms |
6988 KB |
Output isn't correct |
16 |
Incorrect |
176 ms |
7476 KB |
Output isn't correct |
17 |
Incorrect |
183 ms |
10500 KB |
Output isn't correct |
18 |
Incorrect |
171 ms |
11824 KB |
Output isn't correct |
19 |
Incorrect |
285 ms |
15232 KB |
Output isn't correct |
20 |
Incorrect |
254 ms |
16812 KB |
Output isn't correct |