当前位置:网站首页>[dynamic planning] interval dp:p3205 Chorus
[dynamic planning] interval dp:p3205 Chorus
2022-07-02 00:57:00 【muse_ age】



Code :
Be careful
1. Fill in the form from small range to large range :
2. Take the mold after each addition
#include<iostream>
using namespace std;
int n;
int a[1001];
int dp[1001][1001][2];
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
dp[i][i][0]=1;
}
for(int len=2;len<=n;len++){
for(int i=1;i+len-1<=n;i++){
int j=i+len-1;
dp[i][j][0]=(dp[i+1][j][0]*(a[i]<a[i+1])+dp[i+1][j][1]*(a[i]<a[j]))%19650827;
dp[i][j][1]=(dp[i][j-1][1]*(a[j]>a[j-1])+dp[i][j-1][0]*(a[j]>a[i]))%19650827;
}
}
cout<<(dp[1][n][1]+dp[1][n][0])%19650827;
}
边栏推荐
- Global and Chinese market of collaborative applications 2022-2028: Research Report on technology, participants, trends, market size and share
- [opencv450] hog+svm and hog+cascade for pedestrian detection
- 2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details
- Mitsubishi PLC FX3U pulse axis jog function block (mc_jog)
- SQL injection for Web Security (2)
- Bc35 & bc95 onenet mqtt (old)
- Weather forecast applet source code weather wechat applet source code
- Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
- 【底部弹出-选择器】uniapp Picker组件——底部弹起的滚动选择器
- Node -- egg implements the interface of uploading files
猜你喜欢

Creation of volume group for AIX storage management (I)

How to type spaces in latex

Use es to realize epidemic map or take out order function (including code and data)

Slf4j print abnormal stack information

Export default the exported object cannot be deconstructed, and module Differences between exports

2023款雷克萨斯ES产品公布,这回进步很有感
![[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login](/img/c1/23be4399119f42d85a7b86fc8a59fc.png)
[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login

Zak's latest "neural information transmission", with slides and videos

2023 Lexus ES products have been announced, which makes great progress this time

gradle
随机推荐
Global and Chinese markets for food allergens and intolerance tests 2022-2028: Research Report on technology, participants, trends, market size and share
Common loss function of deep learning
Otaku wallpaper Daquan wechat applet source code - with dynamic wallpaper to support a variety of traffic owners
XMIND mind map
RFID让固定资产盘点更快更准
New version of free mobile phone, PC, tablet, notebook four terminal Website thumbnail display diagram online one click to generate website source code
【CTF】bjdctf_2020_babystack2
2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details
Excel search and reference function
Global and Chinese market of ancillary software 2022-2028: Research Report on technology, participants, trends, market size and share
Deb file installation
2022 high altitude installation, maintenance and removal of test question simulation test platform operation
Cookie, session, tooken
[eight sorts ④] merge sort, sort not based on comparison (count sort, cardinal sort, bucket sort)
Recently, three articles in the nature sub Journal of protein and its omics knowledge map have solved the core problems of biology
Powerful calendar wechat applet source code - support the main mode of doing more traffic
Bilstm CRF code implementation
SSO single sign on implementation.
Global and Chinese market of picture archiving and communication system (PACS) 2022-2028: Research Report on technology, participants, trends, market size and share
【八大排序①】插入排序(直接插入排序、希尔排序)