Submission #889576

#TimeUsernameProblemLanguageResultExecution timeMemory
889576vjudge1Council (JOI23_council)C++17
8 / 100
4059 ms18040 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define ar array #define pb push_back #define ln '\n' #define int long long using i64 = long long; template <class F, class _S> bool chmin(F &u, const _S &v){ bool flag = false; if ( u > v ){ u = v; flag |= true; } return flag; } template <class F, class _S> bool chmax(F &u, const _S &v){ bool flag = false; if ( u < v ){ u = v; flag |= true; } return flag; } signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector <vector<int>> a(n, vector <int> (m)); for ( auto &u: a ){ for ( auto &v: u ) cin >> v; } auto f = [&](int x, int y) -> int{ if ( x == y ) return 0; vector <int> cnt(m); for ( int i = 0; i < n; i++ ){ if ( i == x || i == y ){ continue; } for ( int j = 0; j < m; j++ ){ cnt[j] += a[i][j]; } } int ans = 0; for ( auto &x: cnt ){ ans += (x >= n / 2); } return ans; }; for ( int i = 0; i < n; i++ ){ int mx = 0; for ( int j = 0; j < n; j++ ){ chmax(mx, f(i, j)); } cout << mx << ln; } cout << '\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...