Submission #1357141

#TimeUsernameProblemLanguageResultExecution timeMemory
1357141ezzzayHorses (IOI15_horses)C++20
Compilation error
0 ms0 KiB
#include "horses.h"
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
using boost::multiprecision::cpp_int;

static const ll MOD = 1000000007LL;

vector<ll> x, y;

static int calc() {
    cpp_int pref = 1;
    cpp_int best = 0;

    for (int i = 0; i < (int)x.size(); ++i) {
        pref *= x[i];
        cpp_int cur = pref * y[i];
        if (cur > best) best = cur;
    }

    ll ans = (best % MOD).convert_to<ll>();
    return (int)ans;
}

int init(int N, int X[], int Y[]) {
    x.assign(X, X + N);
    y.assign(Y, Y + N);
    return calc();
}

int updateX(int pos, int val) {
    x[pos] = val;
    return calc();
}

int updateY(int pos, int val) {
    y[pos] = val;
    return calc();
}

Compilation message (stderr)

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