# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
651122 |
2022-10-17T09:14:58 Z |
ymm |
Poi (IOI09_poi) |
C++17 |
|
247 ms |
12092 KB |
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
const int N = 2048;
int n, t, p; // network time protocol
int task_cnt_solved[N];
int par_cnt_solved[N];
int par_sum_solved[N];
bool solved_par_task[N][N];
int ids[N];
bool cmp(int i, int j)
{
if (par_sum_solved[i] < par_sum_solved[j])
return 1;
if (par_sum_solved[i] > par_sum_solved[j])
return 0;
if (par_cnt_solved[i] < par_cnt_solved[j])
return 1;
if (par_cnt_solved[i] > par_cnt_solved[j])
return 0;
return i < j;
}
int main()
{
cin.tie(0) -> sync_with_stdio(false);
cin >> n >> t >> p; --p;
Loop (par,0,n) Loop (task,0,t) {
int x;
cin >> x;
task_cnt_solved[task] += x;
par_cnt_solved[par] += x;
solved_par_task[par][task] = x;
}
Loop (par,0,n) Loop (task,0,t) {
if (solved_par_task[par][task])
par_sum_solved[par] += n - task_cnt_solved[task];
}
iota(ids, ids+n, 0);
sort(ids, ids+n, cmp);
int ans = 0;
for (; ids[ans] != p; ++ans);
cout << par_sum_solved[p] << ' ' << ans+1 << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
464 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
468 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
11 |
Incorrect |
8 ms |
1108 KB |
Output isn't correct |
12 |
Incorrect |
13 ms |
1712 KB |
Output isn't correct |
13 |
Incorrect |
36 ms |
2888 KB |
Output isn't correct |
14 |
Incorrect |
49 ms |
3956 KB |
Output isn't correct |
15 |
Incorrect |
88 ms |
5720 KB |
Output isn't correct |
16 |
Incorrect |
97 ms |
6224 KB |
Output isn't correct |
17 |
Incorrect |
144 ms |
7968 KB |
Output isn't correct |
18 |
Incorrect |
151 ms |
9036 KB |
Output isn't correct |
19 |
Incorrect |
207 ms |
11336 KB |
Output isn't correct |
20 |
Incorrect |
247 ms |
12092 KB |
Output isn't correct |