# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133278 | square1001 | Olympiads (BOI19_olympiads) | C++14 | 104 ms | 4204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <map>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
int N, K, C;
cin >> N >> K >> C;
vector<vector<int> > A(N, vector<int>(K));
for (int i = 0; i < N; ++i) {
for (int j = 0; j < K; ++j) {
cin >> A[i][j];
}
}
vector<vector<int> > perm(K, vector<int>(N));
for (int i = 0; i < K; ++i) {
for (int j = 0; j < N; ++j) {
perm[i][j] = j;
}
sort(perm[i].begin(), perm[i].end(), [&](int j, int k) { return A[j][i] != A[k][i] ? A[j][i] > A[k][i] : j < k; });
}
map<vector<int>, bool> vis;
priority_queue<pair<int, vector<int> > > que;
int maxsum = 0;
for (int i = 0; i < K; ++i) {
maxsum += A[perm[i][0]][i];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |