| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1314899 | hssaan_arif | Horses (IOI15_horses) | C++20 | 0 ms | 0 KiB |
// #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <set>
#include <deque>
#include "horses.h"
using namespace std;
#define endl "\n"
#define pb push_back
#define int long long
#define fi first
#define se second
const int N = 3e5 + 5, M = 1e9 + 7, LG = 20;
int n , A[N] , B[N];
int init(int N, int X[], int Y[]) {
int ans = 0;
n = N;
int cr = 1;
for (int i=0 ; i<N; i++){
cr *= X[i];
ans = max(ans , cr * Y[i]);
A[i] = X[i];
B[i] = Y[i];
}
return ans;
}
int updateX(int pos, int val) {
A[pos] = val;
int ans = 0;
int cr = 1;
for (int i=0 ; i<n; i++){
cr *= A[i];
ans = max(ans , cr * B[i]);
}
return ans;
}
int updateY(int pos, int val) {
B[pos] = val;
int ans = 0;
int cr = 1;
for (int i=0 ; i<n; i++){
cr *= A[i];
ans = max(ans , cr * B[i]);
}
return ans;
}
