# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
938032 | guymmk | Poi (IOI09_poi) | C++14 | 201 ms | 11008 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.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl "\n"
#define vi vector<int>
#define vpii vector<pair<int,int> >
#define umap unordered_map
#define uset unordered_set
#define mk make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define read(x) for (auto& zu: (x)) cin >> zu;
#define F first
#define S second
#define mustawa ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define pii pair<int,int>
#define mishari main
const int inf=1e9+7;
void fa(bool ok){ cout << (ok ? "YES": "NO") << "\n";}
void usaco(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
void solve(){
int n,t,p;
cin>>n>>t>>p;
vector<array<int,3>> v(n);
vector<int>points(n);
bool solved[n][t]={};
for(int i=0;i<n;i++){
for(int j=0;j<t;j++){
int x;
cin>>x;
solved[i][j]=x;
points[j]+=!x;
v[i][1]+=x;
}
}for(int i=0;i<n;i++){
v[i][2]=n-i;
for(int j=0;j<t;j++){
if(solved[i][j]){
v[i][0]+=points[j];
}
}
}sort(allr(v));
for(int i=0;i<n;i++){
if(v[i][2]==n-p+1){
cout<<v[i][0]<<" "<<i+1<<endl;
}
}
}signed mishari(){
mustawa;
int t=1;
//usaco("")
//cin>>t;
while(t--)solve();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |