Submission #348798

#TimeUsernameProblemLanguageResultExecution timeMemory
348798SprdaloHorses (IOI15_horses)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;

const int mod = 1e9 + 7;

void f(ll& x){
    if (x >= mod)
        x %= mod;
}

ll g(ll x){
    f(x);
    return x;
}

vi x, y;

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

    ll s = 1, sol = 0;
    for (int i = 0; i < n; ++i){
        sol = max(sol, g(s*y[i]));
        s *= x[i];
        f(s);
    }

    return sol;
}
/*
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr); 
    cerr.tie(nullptr);    

    int n;
    cin >> n;

    int x[n], y[n];
    for (int i = 0; i < n; ++i)
        cin >> x[i] >> y[i];

    cout << init(n,x,y) << '\n';
}*/

Compilation message (stderr)

/tmp/cc1Y13s1.o: In function `main':
grader.c:(.text.startup+0x903): undefined reference to `updateX(int, int)'
grader.c:(.text.startup+0x97f): undefined reference to `updateY(int, int)'
collect2: error: ld returned 1 exit status