# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
419401 |
2021-06-07T05:00:21 Z |
chirathnirodha |
Poi (IOI09_poi) |
C++17 |
|
400 ms |
4200 KB |
//Coded by Chirath Nirodha
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define I insert
#define P push
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_tree;
const ll mod=1e9+7;
inline void io(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void solve(){
io();
int n,t,p;cin>>n>>t>>p;p--;
bool arr[n][t];
for(int i=0;i<n;i++)for(int j=0;j<t;j++)cin>>arr[i][j];
ll points[t];
for(int j=0;j<t;j++){
points[j]=0;
for(int i=0;i<n;i++)if(!arr[i][j])points[j]++;
}
vector<pair<ll,pair<int,int> > > rank;
for(int i=0;i<n;i++){
ll x=0,y=0;
for(int j=0;j<t;j++)if(arr[i][j]){x+=points[j];y++;}
rank.PB(MP(x,MP(y,-i)));
}
sort(rank.begin(),rank.end());
for(int i=n-1;i>=0;i--){
if(rank[i].S.S==-p){cout<<rank[i].F<<" "<<n-i<<endl;return;}
}
}
int main(){
io();
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
2 ms |
332 KB |
Output is correct |
10 |
Correct |
4 ms |
332 KB |
Output is correct |
11 |
Correct |
12 ms |
436 KB |
Output is correct |
12 |
Correct |
20 ms |
460 KB |
Output is correct |
13 |
Correct |
61 ms |
884 KB |
Output is correct |
14 |
Correct |
87 ms |
1124 KB |
Output is correct |
15 |
Correct |
153 ms |
1764 KB |
Output is correct |
16 |
Correct |
187 ms |
1880 KB |
Output is correct |
17 |
Correct |
249 ms |
2636 KB |
Output is correct |
18 |
Correct |
271 ms |
2972 KB |
Output is correct |
19 |
Correct |
363 ms |
3832 KB |
Output is correct |
20 |
Correct |
400 ms |
4200 KB |
Output is correct |