제출 #738623

#제출 시각아이디문제언어결과실행 시간메모리
738623fractlpaca말 (IOI15_horses)C++17
17 / 100
1574 ms8488 KiB
#include "horses.h" #include <vector> #include <algorithm> #define v vector #define MOD 1000000007 using namespace std; v<int> xs; v<int> ys; int n; // Subtask 1 int solve() { int ma = 0; int pop = 1; for(int i=0; i<n; i++) { pop*=xs[i]; ma = max(ma, pop*ys[i]); } return ma%MOD; } int init(int N, int X[], int Y[]) { n = N; for (int i=0; i<n; i++) { xs.push_back(X[i]); ys.push_back(Y[i]); } return solve(); } int updateX(int pos, int val) { xs[pos] = val; return solve(); } int updateY(int pos, int val) { ys[pos] = val; return solve(); } // Subtask 2 // int updateX(int pos, int val) { // return 0; // } // int updateY(int pos, int val) { // return 0; // }
#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...