Submission #80190

#TimeUsernameProblemLanguageResultExecution timeMemory
80190farukkastamonuda쌀 창고 (IOI11_ricehub)C++14
Compilation error
0 ms0 KiB
#include "ricehub.h" #include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000000 #define md 1000000007 #define li 100005 #define mp make_pair #define pb push_back using namespace std; lo int n,T[10],mx,b,A[li],pre[li],ans; bool chechk(int l,int r){ int mid=(l+r)/2; lo int sum=A[mid]*(mid-l+1)-(pre[mid]-pre[l-1]); sum+=(pre[r]-pre[mid-1])-A[mid]*(r-mid+1); return sum<=b; } lo int besthub(int R,int L,int X[],lo int B){ n=R; for(int i=1;i<=n;i++) A[i]=X[i-1]; mx=L; b=B; for(int i=1;i<=n;i++) pre[i]=pre[i-1]+A[i]; for(int i=1;i<=n;i++){ lo int l=i,r=n; while(l<=r){ int mid=(l+r)/2; if(chechk(i,mid)) l=mid+1; else r=mid-1; } ans=max(ans,l-i); } return ans; }

Compilation message (stderr)

ricehub.cpp: In function 'long long int besthub(int, int, int*, long long int)':
ricehub.cpp:19:8: error: ambiguating new declaration of 'long long int besthub(int, int, int*, long long int)'
 lo int besthub(int R,int L,int X[],lo int B){
        ^~~~~~~
In file included from ricehub.cpp:1:0:
ricehub.h:1:5: note: old declaration 'int besthub(int, int, int*, long long int)'
 int besthub(int R, int L, int X[], long long B);
     ^~~~~~~