Submission #1190079

#TimeUsernameProblemLanguageResultExecution timeMemory
1190079jasonicHorses (IOI15_horses)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fastIO cin.tie(0); ios::sync_with_stdio(false)

const ll MOD = 1e9 + 7;

double xl[500005];
double yl[500005];
ll x[500005];
ll y[500005];
ll n;

ll comp() {
    double mxP = 0.0;
    double prefX = 0.0;
    ll ans = 0;
    ll thing = 1;
    for(int i = 0; i < n; i++) {
        prefX += xl[i];
        thing = ((thing * x[i]) % MOD + MOD) % MOD;
        if(prefX + yl[i] > mxP) {
            mxP = prefX + yl[i];
            ans = ((thing * y[i]) % MOD + MOD) % MOD;
        }
    }

    return ans;
}

ll init(int N, int X[], int Y[]) {
    n = N;
    for(int i = 0; i < n; i++) {
        x[i] = X[i];
        y[i] = Y[i];
        xl[i] = log10(X[i]);
        yl[i] = log10(Y[i]);
    }

    return comp();
}

ll updX(int pos, int val) {
    x[pos] = val;
    xl[pos] = log10(val);

    return comp();
}

ll updY(int pos, int val) {
    y[pos] = val;
    yl[pos] = log10(val);

    return comp();
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccaU0OXG.o: in function `main':
grader.c:(.text.startup+0x10b): undefined reference to `updateX(int, int)'
/usr/bin/ld: grader.c:(.text.startup+0x165): undefined reference to `updateY(int, int)'
collect2: error: ld returned 1 exit status