# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
381859 | thecodingwizard | Last supper (IOI12_supper) | C++11 | 376 ms | 76244 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 <bits/stdc++.h>
#include "advisor.h"
using namespace std;
#define s second
#define f first
queue<int> nextUse[100000];
void ComputeAdvice(int *C, int N, int K, int M) {
vector<int> uses(K, 0);
for (int i = 0; i < N; i++) {
//cout << "using " << C[i] << " at " << i << endl;
nextUse[C[i]].push(i);
}
for (int i = 0; i < N; i++) {
nextUse[i].push(N);
}
// first holds next use time, second holds k-index, third holds whether its among the first k
set<pair<int, pair<int, int>>> stuff;
set<int> inSet;
map<int, int> pos;
map<int, int> revPos;
map<int, int> addedTime;
for (int i = 0; i < K; i++) {
//cout << "ADDING " << nextUse[i].front() << " " << i << " " << 1 << endl;
stuff.insert(make_pair(nextUse[i].front(), make_pair(i, 1)));
nextUse[i].pop();
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |