Submission #1014167

#TimeUsernameProblemLanguageResultExecution timeMemory
101416712345678Council (JOI23_council)C++17
25 / 100
3566 ms22272 KiB
#include <bits/stdc++.h> using namespace std; const int nx=3e5+5, mx=11; int n, m, sm[mx], a[nx][mx], msk[nx], cnt[(1<<mx)+5], res[nx]; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>m; for (int i=1; i<=n; i++) for (int j=0; j<m; j++) cin>>a[i][j], sm[j]+=a[i][j], msk[i]+=a[i][j]*(1<<j); for (int i=1; i<=n; i++) cnt[msk[i]]++; for (int i=1; i<=n; i++) { cnt[msk[i]]--; for (int j=0; j<(1<<m); j++) { if (cnt[j]==0) continue; int tmp=0; for (int k=0; k<m; k++) if ((sm[k]-a[i][k]-((j&(1<<k))>0))>=n/2) tmp++; res[i]=max(res[i], tmp); } cnt[msk[i]]++; } for (int i=1; i<=n;i ++) cout<<res[i]<<'\n'; }
#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...