이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5+5;
const int MAXM = 25;
bool votes[MAXN][MAXM];
int vsum[MAXM];
int n, m;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> votes[i][j];
vsum[j] += votes[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) vsum[j] -= votes[i][j];
int mx = 0;
for (int k = 0; k < n; k++) {
if (k == i) continue;
int num = 0;
for (int j = 0; j < m; j++) {
num += (vsum[j]-votes[k][j] >= n/2);
}
mx = max(mx, num);
}
for (int j = 0; j < m; j++) vsum[j] += votes[i][j];
cout << mx << '\n';
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |