# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
818050 | SUNWOOOOOOOO | Council (JOI23_council) | C++17 | 339 ms | 980 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.
// joisc 2023 : council
#include <bits/stdc++.h>
using namespace std;
const int mxN = 3000, mxM = 20;
int n, m, A[mxN][mxM], s[mxM];
int main()
{
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
scanf("%d", &A[i][j]);
s[j] += A[i][j];
}
}
for (int i = 0; i < n; i++){
int ans = 0;
for (int j = 0; j < m; j++) s[j] -= A[i][j];
for (int k = 0; k < n; k++){
if (i == k) continue;
int ret = 0;
for (int j = 0; j < m; j++) s[j] -= A[k][j];
for (int j = 0; j < m; j++) if (s[j] >= n / 2) ret++;
for (int j = 0; j < m; j++) s[j] += A[k][j];
ans = max(ans, ret);
}
for (int j = 0; j < m; j++) s[j] += A[i][j];
printf("%d\n", ans);
}
return 0;
}
Compilation message (stderr)
# | 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... |