QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#178584#2001. Tropical GardenModyKachefCompile Error//C++201.0kb2023-09-14 06:53:322023-09-14 06:53:32

Judging History

你现在查看的是最新测评结果

  • [2023-09-14 06:53:32]
  • 评测
  • [2023-09-14 06:53:32]
  • 提交

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.