# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128016 | onjo0127 | AAQQZ (JOI15_aaqqz) | C++11 | 1101 ms | 9352 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>
using namespace std;
int N, C, A[3009], U[3009], ans;
bool D[3009][3009];
void go(int s, int e) {
if(s < 0 || N < e || s > e) return;
int p = -1;
vector<int> T;
for(int i=s-1; i>=1; i--) {
if(p == -1 || p <= A[i]) {
T.push_back(A[i]);
p = A[i];
}
else break;
}
int l = 0, r = (int)T.size() - 1;
while(l <= r) {
int m = l+r >> 1;
vector<int> H(C+1, 0);
for(int i=0; i<=m; i++) ++H[T[i]];
int c = 0;
bool f = 1, sr = 1;
for(int i=e+1; i<=N && c<=m; i++) {
if(H[A[i]]) {
--H[A[i]];
++c;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |