Submission #133278

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1332782019-07-20 10:35:53square1001Olympiads (BOI19_olympiads)C++14
100 / 100
104 ms4204 KiB
#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];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

olympiads.cpp: In function 'int main()':
olympiads.cpp:57:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 1; i <= K - id.size(); ++i) {
                    ~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...