Submission #611970

#TimeUsernameProblemLanguageResultExecution timeMemory
611970tranxuanbachPoi (IOI09_poi)C++17
100 / 100
286 ms16236 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define endl '\n' #define fi first #define se second #define For(i, l, r) for (auto i = (l); i < (r); i++) #define ForE(i, l, r) for (auto i = (l); i <= (r); i++) #define FordE(i, l, r) for (auto i = (l); i >= (r); i--) #define Fora(v, a) for (auto v: (a)) #define bend(a) (a).begin(), (a).end() #define isz(a) ((signed)(a).size()) using ll = long long; using ld = long double; using pii = pair <int, int>; using vi = vector <int>; using vpii = vector <pii>; using vvi = vector <vi>; const int N = 2e3 + 5; int n, m, k; int a[N][N]; int b[N], c[N], d[N]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("KEK.inp", "r", stdin); // freopen("KEK.out", "w", stdout); cin >> n >> m >> k; ForE(i, 1, n){ ForE(j, 1, m){ cin >> a[i][j]; } } ForE(j, 1, m){ ForE(i, 1, n){ if (a[i][j] == 0){ b[j]++; } } ForE(i, 1, n){ if (a[i][j] == 1){ c[i] += b[j]; d[i]++; } } } cout << c[k] << ' '; vi e(n); iota(bend(e), 1); sort(bend(e), [&](int i, int j){ if (c[i] != c[j]){ return c[i] > c[j]; } if (d[i] != d[j]){ return d[i] > d[j]; } return i < j; }); ForE(i, 1, n){ if (e[i - 1] == k){ cout << i << endl; break; } } } /* ==================================================+ INPUT: | --------------------------------------------------| --------------------------------------------------| ==================================================+ OUTPUT: | --------------------------------------------------| --------------------------------------------------| ==================================================+ */
#Verdict Execution timeMemoryGrader output
Fetching results...