Submission #571827

#TimeUsernameProblemLanguageResultExecution timeMemory
571827beaconmc말 (IOI15_horses)C++14
17 / 100
1588 ms8532 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3") typedef long long ll; #define ll int #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) #define double long double // #include "horses.h" using namespace std; vector<ll> x, y; ll n; int init(int N, int X[], int Y[]) { n = N; x.push_back(X[0]); y.push_back(Y[0]); FOR(i,1,N){ x.push_back(x[i-1] * X[i]); y.push_back(Y[i]); } ll maxi = -1; FOR(i,0,N){ maxi = max(maxi, x[i] * y[i]); } return maxi; } int updateX(int pos, int val) { ll prev = x[pos]; x[pos] = val; FOR(i,pos+1,n){ x[i] /= prev; x[i] *= pos; } ll maxi = -1; FOR(i,0, n){ maxi = max(maxi, x[i] * y[i]); } return maxi; } int updateY(int pos, int val) { y[pos] = val; ll maxi = -1; FOR(i,0, n){ maxi = max(maxi, x[i] * y[i]); } return maxi; }
#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...