# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
936672 | Malix | Poi (IOI09_poi) | C++14 | 205 ms | 24008 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;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
//freopen("test_input.txt", "r", stdin);
//freopen("test_output.txt", "w", stdout);
int n,t,p;cin>>n>>t>>p;
vector<vi> arr(n,vi(t));
REP(i,0,n)REP(j,0,t)cin>>arr[i][j];
vi m(t,0);
REP(j,0,t)REP(i,0,n)m[j]+=abs(arr[i][j]-1);
vector<vi> s(n,vi(3));
REP(i,0,n){
s[i][0]=0;
s[i][1]=0;
s[i][2]=-i;
}
REP(i,0,n)REP(j,0,t)if(arr[i][j]){
s[i][0]+=m[j];
s[i][1]++;
}
sort(s.begin(),s.end());
reverse(s.begin(),s.end());
int ans=0;int ans2=0;
REP(i,0,n)if(s[i][2]==1-p){
ans=i+1;
ans2=s[i][0];
}
cout<<ans2<<" "<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |