# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
954536 | LCJLY | 건물 4 (JOI20_building4) | C++14 | 285 ms | 145980 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,pii>pi2;
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
int n;
int a[1000005];
int b[1000005];
pii memo[1000005][2];
pii dp(int index, bool amos){
if(index>2*n){
return memo[index][amos]={0,0};
}
if(memo[index][amos].first!=-1) return memo[index][amos];
pii ans={INT_MAX,INT_MIN};
if(amos){
if(a[index]>=a[index-1]){
pii hold=dp(index+1,true);
if(hold.first<=hold.second){
ans.first=min(ans.first,hold.first+1);
ans.second=max(ans.second,hold.second+1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |