제출 #732134

#제출 시각아이디문제언어결과실행 시간메모리
732134josanneo22말 (IOI15_horses)C++17
17 / 100
1569 ms12268 KiB
#include "horses.h" #include<bits/stdc++.h> #include<iostream> #include<stdlib.h> #include<cmath> #include <algorithm> #include<numeric> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pair<int, int> > vpii; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef vector<ll> vll; #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define trav(a,x) for (auto& a: x) #define fr(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>=(b); i+=(s)) #define mp make_pair #define pb push_back #define sz(x) int(x.size()) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define in insert #define yes cout<<"YES\n" #define no cout<<"NO\n" #define out(x) cout<<x<<'\n' int dx[4] = { -1, 0, 1, 0 }; int dy[4] = { 0, 1, 0, -1 }; int dx8[8]={0,0,-1,1,-1,1,-1,1}; int dy8[8]={-1,1,0,0,-1,1,1,-1}; char buf[1<<23],*p1=buf,*p2=buf; #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++) inline int rd() { int s=0; char ch=getchar(),last; while(ch<'0'||ch>'9') last=ch,ch=getchar(); while(ch>='0'&&ch<='9') s=(s<<1)+(s<<3)+(ch^48),ch=getchar(); return last=='-'?-s:s; } int num[100]; inline void rt(int x) { if(x<0) putchar('-'),x=-x;; int len=0; do num[len++]=x%10;while(x/=10); while(len--) putchar(num[len]+'0'); } int n; vector<int> x,y; int solve(){ vi pre(n); pre[0]=x[0]; FOR(i,1,n) pre[i]=pre[i-1]*x[i]; int ans=0; FOR(i,0,n) ans=max(ans,y[i]*pre[i]); return ans; } int init(int N, int X[], int Y[]) { n=N; x.resize(n);y.resize(n); FOR(i,0,n) x[i]=X[i]; FOR(i,0,n) y[i]=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...