Submission #1247203

#TimeUsernameProblemLanguageResultExecution timeMemory
1247203SpyrosAlivHorses (IOI15_horses)C++20
17 / 100
1593 ms8420 KiB
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int n;
vector<int> x, y;

int init(int N, int X[], int Y[]) {
	n = N;
	for (int i = 0; i < n; i++) {
		x.push_back(X[i]);
		y.push_back(Y[i]);
	}
	int ans = 0;
	int tot = 1;
	for (int i = 0; i < n; i++) {
		tot *= x[i];
		ans = max(ans, tot * y[i]);
	}
	return ans;
}

int updateX(int pos, int val) {	
	x[pos] = val;
	int ans = 0;
	int tot = 1;
	for (int i = 0; i < n; i++) {
		tot *= x[i];
		ans = max(ans, tot * y[i]);
	}
	return ans;
}

int updateY(int pos, int val) {
	y[pos] = val;
	int ans = 0;
	int tot = 1;
	for (int i = 0; i < n; i++) {
		tot *= x[i];
		ans = max(ans, tot * y[i]);
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...