Submission #332904

#TimeUsernameProblemLanguageResultExecution timeMemory
332904shrek12357Horses (IOI15_horses)C++14
17 / 100
1581 ms8824 KiB
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <set> #include <climits> #include <cmath> #include <fstream> #include <queue> #include <stack> #include <bitset> //#include "cave.h" using namespace std; #define ll long long //cin.tie(0);ios_base::sync_with_stdio(0); const int MOD = 1e9 + 7; vector<int> x, y; int n; int solve() { ll cur = 1; ll ans = 0; for (int i = 0; i < n; i++) { cur *= x[i]; ans = max(ans, cur * y[i]); } ans = ans % MOD; return (int)ans; } 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]); } return solve(); } int updateX(int pos, int val) { x[pos] = val; return solve(); } int updateY(int pos, int val) { y[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...