Submission #571831

# Submission time Handle Problem Language Result Execution time Memory
571831 2022-06-02T20:01:01 Z beaconmc Horses (IOI15_horses) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
typedef long long ll;
#define int ll 
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
#define double long double

// #include "horses.h"
using namespace std;


vector<ll> x, y, xx, yy;
ll n;

int init(int N, int X[], int Y[]) {
	n = N;
	FOR(i,0,N){
		xx.push_back(X[i]);
		yy.push_back(Y[i]);
	}
	x.push_back(X[0]);
	y.push_back(Y[0]);

	FOR(i,1,N){
		x.push_back(x[i-1] * X[i]);
		y.push_back(Y[i]);
	}
	ll maxi = -1;
	FOR(i,0,N){
		maxi = max(maxi, x[i] * y[i]);
	}
	return maxi;
}

int updateX(int pos, int val) {	
	ll prev = xx[pos];

	xx[pos] = val;
	

	FOR(i,pos,n){
		cout << prev << " " << val << endl;
		x[i] /= prev;
		x[i] *= val;
	}

	ll maxi = -1;
	FOR(i,0, n){
		maxi = max(maxi, x[i] * y[i]);
	}
	return maxi%1000000007;
}

int updateY(int pos, int val) {
	y[pos] = val;
	ll maxi = -1;
	FOR(i,0, n){
		cout << x[i] << " " << y[i] << endl;
		maxi = max(maxi, x[i] * y[i]);
	}
	return maxi;
}

Compilation message

/usr/bin/ld: /tmp/ccn2jb9w.o: in function `main':
grader.c:(.text.startup+0xaa): undefined reference to `init(int, int*, int*)'
/usr/bin/ld: grader.c:(.text.startup+0x113): undefined reference to `updateX(int, int)'
/usr/bin/ld: grader.c:(.text.startup+0x16d): undefined reference to `updateY(int, int)'
collect2: error: ld returned 1 exit status