제출 #1135442

#제출 시각아이디문제언어결과실행 시간메모리
1135442gyg말 (IOI15_horses)C++20
17 / 100
1595 ms12168 KiB
// 0 indexed btw #include "horses.h" #include <bits/stdc++.h> using namespace std; #define lint long long #define arr array const int N = 5e5 + 5; const lint MD = 1e9 + 7; int n; arr<lint, N> grw, prc; lint md(lint x) { return (x + MD) % MD; } int init(int _n, int _grw[], int _prc[]) { n = _n; for (int i = 1; i <= n; i++) grw[i] = _grw[i - 1], prc[i] = _prc[i - 1]; lint cr = 1, ans = 0; for (int i = 1; i <= n; i++) { cr = md(cr * grw[i]); ans = max(ans, md(cr * prc[i])); } return ans; } int updateX(int id, int vl) { id++, grw[id] = vl; lint cr = 1, ans = 0; for (int i = 1; i <= n; i++) { cr = md(cr * grw[i]); ans = max(ans, md(cr * prc[i])); } return ans; } int updateY(int id, int vl) { id++, prc[id] = vl; lint cr = 1, ans = 0; for (int i = 1; i <= n; i++) { cr = md(cr * grw[i]); ans = max(ans, md(cr * prc[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...