# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
259521 |
2020-08-08T00:59:23 Z |
c4ts0up |
Poi (IOI09_poi) |
C++17 |
|
889 ms |
17560 KB |
/*
ID: c4ts0up
LANG: C++
TASK:
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
const int NMAX = 2005;
int n, t, p;
vector <int> tasks, scores;
vector <int> done[NMAX];
int main() {
/*//
freopen("", "r", stdin);
freopen("", "w", stdout);
//*/
cin >> n >> t >> p;
scores.resize(n+1);
tasks.resize(t);
for (int i=1; i<=n; i++) {
for (int j=0; j<t; j++) {
int aux;
cin >> aux;
tasks[j] += aux;
if (aux) done[i].pb(j);
}
}
for (int i=1; i<=n; i++) {
for (int x : done[i]) scores[i] += n-tasks[x];
}
int philscore = scores[p];
int philsolved = done[p].size();
int above = 0;
for (int i=1; i<=n; i++) {
if (scores[i] > philscore) above++;
else if (scores[i] < philscore) continue;
// mismo puntaje
else {
if (done[i].size() > philsolved) above++;
else if (done[i].size() < philsolved) continue;
// mismo numero de tareas resueltas
else {
if (i < p) above++;
else continue;
}
}
}
cout << philscore << " " << above+1 << endl;
return 0;
}
Compilation message
poi.cpp: In function 'int main()':
poi.cpp:56:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (done[i].size() > philsolved) above++;
~~~~~~~~~~~~~~~^~~~~~~~~~~~
poi.cpp:57:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (done[i].size() < philsolved) continue;
~~~~~~~~~~~~~~~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
0 ms |
384 KB |
Output is correct |
4 |
Correct |
0 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
2 ms |
384 KB |
Output is correct |
8 |
Correct |
2 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
10 ms |
512 KB |
Output is correct |
11 |
Correct |
32 ms |
896 KB |
Output is correct |
12 |
Correct |
45 ms |
1272 KB |
Output is correct |
13 |
Correct |
134 ms |
2936 KB |
Output is correct |
14 |
Correct |
208 ms |
4088 KB |
Output is correct |
15 |
Correct |
340 ms |
8184 KB |
Output is correct |
16 |
Correct |
375 ms |
8828 KB |
Output is correct |
17 |
Correct |
535 ms |
11256 KB |
Output is correct |
18 |
Correct |
612 ms |
12536 KB |
Output is correct |
19 |
Correct |
804 ms |
15480 KB |
Output is correct |
20 |
Correct |
889 ms |
17560 KB |
Output is correct |