제출 #28813

#제출 시각아이디문제언어결과실행 시간메모리
28813dereotu쌀 창고 (IOI11_ricehub)C++14
42 / 100
1000 ms5964 KiB
#include "ricehub.h" #include <bits/stdc++.h> #define pii pair<int,int> #define mp make_pair #define pb push_back #define st first #define nd second #define forr(i,A,B) for(int i=A;i<B;++i) #define space ' ' #define endl '\n' #define LL long long using namespace std; int a[10005],ans; int besthub(int R, int L, int X[], long long B){ forr(i,0,L){ int b=0,h=0; memset(a,0,sizeof a); forr(j,0,R){ a[j]=abs(X[j]-i); } sort(a,a+R); forr(j,0,R){ if(b+a[j]<=B){ b+=a[j]; h++; } else break; } ans=max(ans,h); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...