# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
678662 | penguin133 | Poi (IOI09_poi) | C++17 | 564 ms | 23732 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;
int main(){
int n,m,k;
cin >> n >> m >> k;
int grid[n][m];
int cnt[m];
memset(cnt,0,sizeof(cnt));
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin >> grid[i][j];
if(grid[i][j] == 1){
cnt[j]++;
}
}
}
int cnt2 = 0,cnt3 = 0,cnt5 = 0;
for(int i=0;i<m;i++){
cnt[i] = n - cnt[i];
if(grid[k-1][i] == 1){
cnt2 += cnt[i];
cnt5++;
}
}
cout << cnt2 << " ";
int cnt4 = 0,cnt6 = 0;
for(int i=0;i<n;i++){
cnt3 = 0;
cnt6 = 0;
if(i == k-1)continue;
for(int j=0;j<m;j++){
if(grid[i][j] == 1){
cnt3 += cnt[j];
cnt6++;
}
}
if(cnt3 > cnt2){
cnt4++;
}
else if(cnt3 == cnt2){
if(cnt6 > cnt5){
cnt4++;
}
else if(cnt6 == cnt5){
if(i < k-1){
cnt4++;
}
}
}
}
cout << cnt4+1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |