Submission #1151057

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11510572025-02-16 08:19:42KhoaDuyLast supper (IOI12_supper)C++20
0 / 100
49 ms4424 KiB
#include "advisor.h"
#include<bits/stdc++.h>
using namespace std;
void ComputeAdvice(int *C,int n,int k,int m){
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();
if((*it).first==i){
se.erase(it);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...