Submission #1046540

#TimeUsernameProblemLanguageResultExecution timeMemory
1046540GusterGoose27Council (JOI23_council)C++17
16 / 100
4094 ms8964 KiB
#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 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...