제출 #936672

#제출 시각아이디문제언어결과실행 시간메모리
936672MalixPoi (IOI09_poi)C++14
100 / 100
205 ms24008 KiB
#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 timeMemoryGrader output
Fetching results...