QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#757113#9552. The Chariotucup-team3584#Compile Error//C++234.0kb2024-11-17 00:21:422024-11-17 00:21:43

Judging History

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

  • [2024-11-17 00:21:43]
  • 评测
  • [2024-11-17 00:21:42]
  • 提交

answer

#include <string.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> using vvvc = vector<vector<vector<T>>>;
template<class T> using pq = priority_queue<T,vector<T>,greater<T>>;
template <class T, class S> inline bool chmax(T &a, const S &b) { return (a < b ? a = b, 1 : 0); }
template <class T, class S> inline bool chmin(T &a, const S &b) { return (a > b ? a = b, 1 : 0); }

int dx4[] = {1,0,-1,0};
int dy4[] = {0,1,0,-1};

#define overload5(a, b, c, d, e, name, ...) name
#define overload4(a, b, c, d, name, ...) name
#define REP0(n) for(ll jidlsjf = 0; jidlsjf < n; ++jidlsjf)
#define REP1(i, n) for(ll i = 0; i < (n); ++i)
#define REP2(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP3(i, a, b, c) for(ll i = (a); i < (b); i += (c))
#define rep(...) overload4(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define per0(n) for(int jidlsjf = 0; jidlsjf < (n); ++jidlsjf)
#define per1(i, n) for(ll i = (n)-1; i >= 0; --i)
#define per2(i, a, b) for(ll i = (a)-1; i >= b; --i)
#define per3(i, a, b, c) for(ll i = (a)-1; i >= (b); i -= (c))
#define per(...) overload4(__VA_ARGS__, per3, per2, per1, per0)(__VA_ARGS__)
#define setbits(j, n) for(ll iiiii = (n), j = lowbit(iiiii); iiiii; iiiii ^= 1 << j, j = lowbit(iiiii))
#define perm(v) for(bool permrepflag = true; (permrepflag ? exchange(permrepflag, false) : next_permutation(all(v)));)
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define ppf pop_front
#define drop(s) cout << #s << endl, exit(0)
#define si(c) (int)(c).size()
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define lbg(c, x) distance((c).begin(), lower_bound(all(c), (x), greater{}))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define ubg(c, x) distance((c).begin(), upper_bound(all(c), (x), greater{}))
#define rng(v, l, r) v.begin() + (l), v.begin() + (r)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define SORT(v) sort(all(v))
#define REV(v) reverse(all(v))
#define UNIQUE(x) SORT(x), x.erase(unique(all(x)), x.end())
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while(t--) {
      Bint A,B,C,X,Y,D;
      cin >> A >> B >> C >> X >> Y >> D;
      if(D < X) {
        cout << A << endl;
        continue;
      }
      Bint ans = (D+X-1)/X*A;
      {
        Bint now = 0;
        now += D/X*A;
        now += min(Y,D%X)*B;
        now += max(Bint(0),D%X-Y)*C;
        ans = min(ans,now);
      }
      {
        Bint now = 0;
        now += D/X*A;
        Bint rem = D%X,num = D/X;
        now += min(rem,num*Y)*B;
        now += max(Bint(0),rem-num*Y)*C;
        ans = min(ans,now);
      }
      {
        Bint now = A+B*Y;
        now += max(Bint(0),D-X-Y)*C;
        ans = min(ans,now);
      }
      if(D >= X+Y) {
        Bint now = D/(X+Y)*(A+B*Y);
        now += D%(X+Y)*C;
        ans = min(ans,now);
      }
      if(D >= X+Y) {
        Bint now = D/(X+Y)*(A+B*Y)+A;
        now += max(Bint(0),D%(X+Y)-X)*B;
        ans = min(ans,now);
      }
      cout << ans << endl;
    }
}

详细

answer.code:78:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   78 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.