Submission #819675

# Submission time Handle Problem Language Result Execution time Memory
819675 2023-08-10T12:33:19 Z Gangsta Horses (IOI15_horses) C++14
Compilation error
0 ms 0 KB
/*
ID: didarco1
LANG: C++17
TASK:
*/
// a >> b = a / pow(2,b)
// a << b = a * pow(2,b)
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define sz size()
#define ss second
#define ff first
#define N 200001
#define pii pair<int,int>
#define all(x) (x.begin(),x.end())

using namespace std;

ll  MOD = 1e9+7;

ll mod(ll x){
	if(x >= MOD) x %= MOD;
	return x;
}

void updateX(int pos, int val){
	
}

void updateY(int pos, int val){
	
}

//
//void upd(int nd, int l, int r, int x, int y){
//	if(l == r and l == y){
//		sell[i]
//	}
//}

ll init(int n, vector <int> X, vector<int> Y){
	ll hrs = 1, mx = 0;
//	for(int i = 1; i <= n; i++){
//		hrs *= X[i];
//		sell[i] = hrs * Y[i];
//	}
//	for(int i = 1; i <= n; i++){
//		upd(1,1,n,i,sell[i]);
//	}
	for(int i = 0; i < n; i++){
		hrs = mod((ll)(hrs * X[i]));
		mx = max(mx,mod((ll)(hrs*Y[i])));
	}
	return mx;
}

//int main(){
//	int x;
//	cin >> n;
//	for(int i = 0; i < n; i++){
//		cin >> x;
//		X.pb(x);
//	}
//	for(int i = 0; i < n; i++){
//		cin >> x;
//		Y.pb(x);
//	}
//	init(n,X,Y);
//}

Compilation message

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