Submission #1151075

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11510752025-02-16 08:35:34KhoaDuyLast supper (IOI12_supper)C++20
0 / 100
47 ms4424 KiB
#include "advisor.h"
#include<bits/stdc++.h>
using namespace std;
void ComputeAdvice(int *C,int n,int k,int m){
assert(n>1&&k<n&&k>0);
int c[n+k];
for(int i=0;i<n;i++){
c[k+i]=C[i];
}
for(int i=0;i<k;i++){
c[i]=i;
}
int state[n+k]={0};
int last[n];
for(int i=0;i<n;i++){
last[i]=n+k;
}
int nxt[n+k];
for(int i=n+k-1;i>=0;i--){
nxt[i]=last[c[i]];
last[c[i]]=i;
}
set<pair<int,int>> se;
for(int i=0;i<k;i++){
se.insert({nxt[i],i});
}
for(int i=k;i<n+k;i++){
set<pair<int,int>>::iterator it=se.begin();
assert((*it).first>=i);
if((*it).first==i){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...