Submission #1132162

#TimeUsernameProblemLanguageResultExecution timeMemory
1132162lopkusCouncil (JOI23_council)C++20
16 / 100
4091 ms7480 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; int a[n + 1][m + 1]; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { cin >> a[i][j]; } } vector<int> cnt(m + 1, 0); for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { cnt[j] += a[i][j]; } } for(int i = 1; i <= n; i++) { int ans = 0; for(int j = 1; j <= n; j++) { if(j == i) { continue; } int f = 0; for(int k = 1; k <= m; k++) { int u1 = a[i][k]; int u2 = a[j][k]; if((cnt[k] - u1 - u2) > (n - 2) / 2) { f += 1; } } ans = max(ans, f); } cout << ans << "\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...