# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
340584 |
2020-12-27T23:54:05 Z |
rocks03 |
Poi (IOI09_poi) |
C++14 |
|
317 ms |
23916 KB |
//#pragma GCC target("avx2")
//#pragma GCC optimization("O3")
//#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define SZ(x) ((int)(x).size())
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct contestant{
int score, sum, id;
bool operator<(const contestant& other) const{
if(score == other.score){
if(sum == other.sum){
return id < other.id;
}
return sum > other.sum;
}
return score > other.score;
}
};
void solve(){
int N, T, P;
cin >> N >> T >> P;
--P;
vector<int> score(T, N);
int task[N][T];
for(int i = 0; i < N; i++){
for(int t = 0; t < T; t++){
cin >> task[i][t];
if(task[i][t]) score[t]--;
}
}
contestant a[N];
for(int i = 0; i < N; i++){
a[i].score = a[i].sum = 0;
a[i].id = i;
for(int t = 0; t < T; t++){
if(task[i][t]){
a[i].score += score[t];
a[i].sum++;
}
}
}
sort(a, a+N);
for(int i = 0; i < N; i++){
if(a[i].id == P){
cout << a[i].score << " " << i + 1;
}
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
3 ms |
492 KB |
Output is correct |
11 |
Correct |
10 ms |
1004 KB |
Output is correct |
12 |
Correct |
18 ms |
1516 KB |
Output is correct |
13 |
Correct |
52 ms |
3820 KB |
Output is correct |
14 |
Correct |
68 ms |
5356 KB |
Output is correct |
15 |
Correct |
120 ms |
9196 KB |
Output is correct |
16 |
Correct |
131 ms |
9964 KB |
Output is correct |
17 |
Correct |
192 ms |
14464 KB |
Output is correct |
18 |
Correct |
223 ms |
16384 KB |
Output is correct |
19 |
Correct |
288 ms |
21776 KB |
Output is correct |
20 |
Correct |
317 ms |
23916 KB |
Output is correct |