Submission #739643

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7396432023-05-10 21:42:54sidonCouncil (JOI23_council)C++17
100 / 100
3511 ms23632 KiB
#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]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...