제출 #247400

#제출 시각아이디문제언어결과실행 시간메모리
247400ernestvw말 (IOI15_horses)C++11
17 / 100
1572 ms14456 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; int n; vector<ll> C, P; int solve() { ll ans = 0; ll prod = 1; for(int i = 0; i < n; ++i) { prod *= C[i]; ans = max(ans, prod * P[i]); } return int(ans % mod); } int init(int N, int X[], int Y[]) { n = N; C.resize(n); P.resize(n); for(int i = 0; i < n; ++i) C[i] = X[i]; for(int i = 0; i < n; ++i) P[i] = Y[i]; return solve(); } int updateX(int pos, int val) { C[pos] = val; return solve(); } int updateY(int pos, int val) { P[pos] = val; return solve(); }
#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...