Submission #917817

#TimeUsernameProblemLanguageResultExecution timeMemory
917817NonozeRice Hub (IOI11_ricehub)C++17
100 / 100
13 ms3832 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) { #define int long long int n=R, l=L, b=B; int ans=1; int sum=0; int beg=0; for (int i=0; i<n; i++) { sum+=X[i]; sum-=X[beg+(i-beg)/2]; while (sum>B) { sum+=X[beg]; sum-=X[beg+(i-beg)/2+(i-beg)%2]; beg++; } ans=max(ans, i-beg+1); } return ans; }

Compilation message (stderr)

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:8:11: warning: unused variable 'l' [-Wunused-variable]
    8 |  int n=R, l=L, b=B;
      |           ^
ricehub.cpp:8:16: warning: unused variable 'b' [-Wunused-variable]
    8 |  int n=R, l=L, b=B;
      |                ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...