Submission #1053785

# Submission time Handle Problem Language Result Execution time Memory
1053785 2024-08-11T17:34:17 Z Osplei Horses (IOI15_horses) C++17
Compilation error
0 ms 0 KB
#include "horses.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair <ll, ll> LL;

#define F first
#define S second

ll mod = 1e9 + 7;

ll init(ll N, ll X[], ll Y[]) {
  //pos ans  tengo
  queue <pair <ll, LL>> q;
  ll ans = 0;

  q.push({-1, {0, 1}});

  while (!q.empty()) {
    pair <ll, LL> act;
    act = q.front();
    ans = max(ans, act.S.F);
    
    q.pop();

    if (act.F + 1 >= N) continue;

    q.push({act.F + 1, {act.S.F % mod, (act.S.S * X[act.F + 1]) % mod}});
    q.push({act.F + 1, {((act.S.F % mod) + (((((act.S.S * X[act.F + 1]) % mod) - 1) * Y[act.F + 1]) % mod)) % mod, 1LL}});
    q.push({act.F + 1, {((act.S.F % mod) + ((((act.S.S * X[act.F + 1]) % mod) * Y[act.F + 1]) % mod)) % mod, 0LL}});
  }

	return ans % mod;
}

int updateX(int pos, int val) {	
	return 0;
}

int updateY(int pos, int val) {
	return 0;
}

Compilation message

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:38:17: warning: unused parameter 'pos' [-Wunused-parameter]
   38 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:38:26: warning: unused parameter 'val' [-Wunused-parameter]
   38 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:42:17: warning: unused parameter 'pos' [-Wunused-parameter]
   42 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:42:26: warning: unused parameter 'val' [-Wunused-parameter]
   42 | int updateY(int pos, int val) {
      |                      ~~~~^~~
/usr/bin/ld: /tmp/cczTxQ3U.o: in function `main':
grader.c:(.text.startup+0xaa): undefined reference to `init(int, int*, int*)'
collect2: error: ld returned 1 exit status