# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
739643 | sidon | Council (JOI23_council) | C++17 | 3511 ms | 23632 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;
const int B = 10;
array<int, 2> s[1<<B][1<<B][2];
int popcount[1<<B];
signed main() {
cin.tie(0)->sync_with_stdio(0);
for(int i = 0; i < (1<<B); ++i)
popcount[i] = __builtin_popcount(i);
int N, M; cin >> N >> M;
int A[N] {}, c[M] {};
for(int i = 0; i < N; ++i) {
for(int j = 0; j < M; ++j) {
int v; cin >> v;
A[i] |= v << j;
c[j] += v;
}
int x = A[i] >> B;
for(int j = 0; j < (1<<B); ++j) {
int v = popcount[~A[i] & j];
if(v > s[x][j][0][0]) s[x][j][0] = {v, i};
if(v > s[x][j][1][0]) swap(s[x][j][0], s[x][j][1]);
}
# | 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... |