Submission #289605

#TimeUsernameProblemLanguageResultExecution timeMemory
289605DoxenoRice Hub (IOI11_ricehub)C++17
100 / 100
19 ms1792 KiB
#include<bits/stdc++.h> using namespace std; long long besthub(int N, int L, int risaie[], long long B){ long long left=0,right=0; long long spesa = 0; long long m =1; while(right<N-1){ if(spesa>B){ spesa+=risaie[left]-risaie[(++left+right)/2]; }else{ right++; spesa+=risaie[right]-risaie[(left+right)/2]; // if(spesa<=B)m=max(,max } if(spesa<=B)m=max(m,right-left+1); } return m; }

Compilation message (stderr)

ricehub.cpp: In function 'long long int besthub(int, int, int*, long long int)':
ricehub.cpp:9:32: warning: operation on 'left' may be undefined [-Wsequence-point]
    9 |    spesa+=risaie[left]-risaie[(++left+right)/2];
      |                                ^~~~~~
ricehub.cpp:9:32: warning: operation on 'left' may be undefined [-Wsequence-point]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...