Submission #525350

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5253502022-02-11 12:04:34safaricolaXylophone (JOI18_xylophone)C++17
0 / 100
0 ms200 KiB
#include "xylophone.h"
static int ans[5010],diff1[5010],diff2[5010],mi,ma,miid,maid;
bool greate[5010];
void solve(int N) {
for(int i=1; i<N; i++){
diff1[i]=query(i,i+1);
if(i!=N-1){
diff2[i]=query(i,i+2);
}
}
ans[1]=1;
//greater=1, i<i+1;
for(int i=1; i<N; i++){
if(greate[i]){
ans[i+1]=ans[i]+diff1[i];
if(ans[i+1]>ma){
ma=ans[i+1];
maid=i+1;
}
}
else{
ans[i+1]=ans[i]-diff1[i];
if(ans[i+1]<mi){
mi=ans[i+1];
miid=i+1;
}
}
if(diff1[i+1]+diff1[i]==diff2[i]){
greate[i+1]=greate[i];
}else{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...