QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#178584 | #2001. Tropical Garden | ModyKachef | Compile Error | / | / | C++20 | 1.0kb | 2023-09-14 06:53:32 | 2023-09-14 06:53:32 |
Judging History
This is the latest submission verdict.
- [2023-09-14 06:53:32]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-09-14 06:53:32]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#include "ricehub.h"
int f(int md , signed x[] , int r , int b){
vector<int> v;
for (int i = 0 ; i<r ; i++){
v.pb(abs(md - x[i]));
}
sort(v.begin() , v.end());
int ans =0 , sum = 0;;
for (int i = 0 ; i<r ; i++){
if (sum + x[i] <= b) {sum+=x[i]; ans++;}
else break;
}
return ans;
}
signed besthub(signed R, signed L, signed X[], long long B)
{
int l = 1 , r = L , m1 , m2;
int ans = 0 ;
// for (int i = 1 ; i<=L ; i++) cout << f(i , X , R , B) << ' ';
while(r-l > 2){
m1 = l + (l+r)/3;
m2 = r - (l+r)/3;
int cnt = 0 ;
int a = f(m1 , X , R , B) , b = f(m2 , X , R , B);
if (a < b) l = m1;
else r = m2;
}
int mx = 0 ;
for (int i = l ; i<=r ; i++) mx = max(mx , f(i , X , R , B));
return mx;
}
// signed main(){
// int r , l , b;
// cin >> r >> l >> b;
// signed x[r];
// for (int i = 0 ; i < r ; i++) cin >> x[i];
// cout << besthub(r , l , x , b);
// }
詳細信息
answer.code:5:10: fatal error: ricehub.h: No such file or directory 5 | #include "ricehub.h" | ^~~~~~~~~~~ compilation terminated.