제출 #860809

#제출 시각아이디문제언어결과실행 시간메모리
860809Kak008723Poi (IOI09_poi)C++14
55 / 100
206 ms4432 KiB
#include<bits/stdc++.h> using namespace std; int n,m,k,b[2005]; vector<int> c; bool a[2005][2005]; int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>m>>k; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; } } for(int i=1;i<=m;i++){ int ans = 0; for(int j=1;j<=n;j++){ ans+=a[j][i]; } ans=n-ans; b[i]=ans; } //for(int i=1;i<=m;i++) cout<<b[i]<<' '; //cout<<'\n'; int now = 0 ; for(int i=1;i<=n;i++){ int x = 0; for(int j=1;j<=m;j++){ x+=a[i][j]*b[j]; } if(i==k) now = x; c.push_back(x); } cout<<now; sort(c.rbegin(),c.rend()); int i = 0; while(c[i]!=now) i++; cout<<' '<<i+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...