# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
419404 | chirathnirodha | Poi (IOI09_poi) | C++17 | 398 ms | 4216 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//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];memset(points,0,sizeof(points));
for(int j=0;j<t;j++)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=0;i<n;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 |
---|---|---|---|---|
Fetching results... |