Submission #927799

# Submission time Handle Problem Language Result Execution time Memory
927799 2024-02-15T10:52:06 Z VMaksimoski008 Horses (IOI15_horses) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "horses.h"

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
//#define int long long

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int mod = 1e9 + 7;
const int LOG = 20;
const int maxn = 1e5 + 5;
const double eps = 1e-9;

int n;
vectoc<ll> X(5*maxn), Y(maxn);

ll calc() {
    ll curr = 1, ans = 0;
    for(int i=0; i<n; i++) {
        curr = (curr * X[i]) % mod;
        ans = max(ans, (curr * Y[i]) % 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];
    return calc();
}

ll updateX(int p, int v) {
    X[p] = v;
    return calc();
}

ll updateY(int p, int v) {
    Y[p] = v;
    return calc();
}

Compilation message

horses.cpp:23:1: error: 'vectoc' does not name a type
   23 | vectoc<ll> X(5*maxn), Y(maxn);
      | ^~~~~~
horses.cpp: In function 'll calc()':
horses.cpp:28:24: error: 'X' was not declared in this scope
   28 |         curr = (curr * X[i]) % mod;
      |                        ^
horses.cpp:29:32: error: 'Y' was not declared in this scope
   29 |         ans = max(ans, (curr * Y[i]) % mod);
      |                                ^
horses.cpp: At global scope:
horses.cpp:34:4: error: ambiguating new declaration of 'll init(int, int*, int*)'
   34 | ll init(int N, int x[], int y[]) {
      |    ^~~~
In file included from horses.cpp:2:
horses.h:4:5: note: old declaration 'int init(int, int*, int*)'
    4 | int init(int N, int X[], int Y[]);
      |     ^~~~
horses.cpp: In function 'll init(int, int*, int*)':
horses.cpp:36:28: error: 'X' was not declared in this scope
   36 |     for(int i=0; i<n; i++) X[i] = x[i], Y[i] = y[i];
      |                            ^
horses.cpp:36:41: error: 'Y' was not declared in this scope
   36 |     for(int i=0; i<n; i++) X[i] = x[i], Y[i] = y[i];
      |                                         ^
horses.cpp: At global scope:
horses.cpp:40:4: error: ambiguating new declaration of 'll updateX(int, int)'
   40 | ll updateX(int p, int v) {
      |    ^~~~~~~
In file included from horses.cpp:2:
horses.h:5:5: note: old declaration 'int updateX(int, int)'
    5 | int updateX(int pos, int val);
      |     ^~~~~~~
horses.cpp: In function 'll updateX(int, int)':
horses.cpp:41:5: error: 'X' was not declared in this scope
   41 |     X[p] = v;
      |     ^
horses.cpp: At global scope:
horses.cpp:45:4: error: ambiguating new declaration of 'll updateY(int, int)'
   45 | ll updateY(int p, int v) {
      |    ^~~~~~~
In file included from horses.cpp:2:
horses.h:6:5: note: old declaration 'int updateY(int, int)'
    6 | int updateY(int pos, int val);
      |     ^~~~~~~
horses.cpp: In function 'll updateY(int, int)':
horses.cpp:46:5: error: 'Y' was not declared in this scope
   46 |     Y[p] = v;
      |     ^