Submission #1046934

#TimeUsernameProblemLanguageResultExecution timeMemory
1046934dpsaveslivesHorses (IOI15_horses)C++17
17 / 100
1553 ms10440 KiB
#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const int MAXN = 5e5+1; 
const int MOD = 1e9+7; 
int x[MAXN], y[MAXN], n; 
ll init(int N, int X[], int Y[]){
    ll cur = 1ll, ans = 1ll; n = N; 
    for(int i = 0;i<N;++i){
        x[i] = X[i]; 
        y[i] = Y[i]; 
        cur = cur*X[i]%MOD; 
        ans = max(ans,cur*Y[i]%MOD); 
    }
    return ans;
}
ll updateX(int pos, int val){
    x[pos] = val;
    ll cur = 1ll, ans = 1ll; 
    for(int i = 0;i<n;++i){
        cur = cur*x[i]%MOD; 
        ans = max(ans,cur*y[i]%MOD); 
    }
    return ans;
}
ll updateY(int pos, int val){
    y[pos] = val;
    ll cur = 1ll, ans = 1ll; 
    for(int i = 0;i<n;++i){
        cur = cur*x[i]%MOD; 
        ans = max(ans,cur*y[i]%MOD); 
    }
    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...