# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
696552 |
2023-02-06T19:26:31 Z |
Hacv16 |
Poi (IOI09_poi) |
C++17 |
|
216 ms |
64324 KB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 2e6 + 15;
const int INF = 0x3f3f3f3f;
int n, t, p, value[MAX], score[MAX];
vector<int> solve[MAX];
int32_t main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> t >> p;
for(int i = 1; i <= t; i++) value[i] = n;
for(int i = 1; i <= n; i++){
for(int k = 1; k <= t; k++){
ll x; cin >> x;
if(x){ value[k]--; solve[i].push_back(k); }
}
}
for(int i = 1; i <= n; i++)
for(auto x : solve[i])
score[i] += value[x];
vector<int> rank(n);
iota(rank.begin(), rank.end(), 1);
sort(rank.begin(), rank.end(), [ & ](int x, int y) { return score[x] > score[y]; });
for(int i = 0; i < rank.size(); i++)
if(rank[i] == p){ cout << score[p] << ' ' << i + 1 << '\n'; exit(0); }
}
Compilation message
poi.cpp: In function 'int32_t main()':
poi.cpp:35:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
35 | for(int i = 0; i < rank.size(); i++)
| ~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
47248 KB |
Output is correct |
2 |
Correct |
25 ms |
47188 KB |
Output is correct |
3 |
Incorrect |
24 ms |
47188 KB |
Output isn't correct |
4 |
Incorrect |
24 ms |
47188 KB |
Output isn't correct |
5 |
Incorrect |
30 ms |
47280 KB |
Output isn't correct |
6 |
Correct |
26 ms |
47180 KB |
Output is correct |
7 |
Correct |
28 ms |
47280 KB |
Output is correct |
8 |
Correct |
25 ms |
47308 KB |
Output is correct |
9 |
Incorrect |
25 ms |
47268 KB |
Output isn't correct |
10 |
Correct |
26 ms |
47420 KB |
Output is correct |
11 |
Correct |
30 ms |
47780 KB |
Output is correct |
12 |
Incorrect |
36 ms |
48096 KB |
Output isn't correct |
13 |
Incorrect |
53 ms |
49868 KB |
Output isn't correct |
14 |
Incorrect |
67 ms |
50928 KB |
Output isn't correct |
15 |
Incorrect |
103 ms |
55060 KB |
Output isn't correct |
16 |
Correct |
107 ms |
55604 KB |
Output is correct |
17 |
Incorrect |
140 ms |
58020 KB |
Output isn't correct |
18 |
Correct |
157 ms |
59460 KB |
Output is correct |
19 |
Incorrect |
209 ms |
62332 KB |
Output isn't correct |
20 |
Correct |
216 ms |
64324 KB |
Output is correct |