Submission #1270035

#TimeUsernameProblemLanguageResultExecution timeMemory
1270035martin_011말 (IOI15_horses)C++20
17 / 100
1596 ms12320 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; const ll mod = 1e9 + 7; vll a, b; ll n; int init(int N, int x[], int y[]) { ll res = 0; n = N; ll act = 1; for (int i=0; i<n; i++) { a.push_back(x[i]); b.push_back(y[i]); res = max(res, (act * a[i]) * b[i]); act *= a[i]; } return res % mod; } int updateX(int pos, int val) { ll res = 0; a[pos]=val; ll act=1; for (int i=0; i<n; i++) { res = max(res, (act * a[i]) * b[i]); act *= a[i]; } return res % mod; } int updateY(int pos, int val) { ll res = 0; b[pos]=val; ll act = 1; for (int i=0; i<n; i++) { res = max(res, (act * a[i]) * b[i]); act *= a[i]; } return res % mod; }
#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...