DP就是每次在原序列右边加一个city的时候 (此时n个city) 只要看前一个状态 (n-1个city) 最右边的city的情况
也就是记录n个city时的三个状态 xxxV xxx> xxx<
xxxV 和 xxx< 的数量和就是要求的结果, xxx>是记录一下如果允许向右流水那么方案的数量
状态转移即为右图
然后dp[100]结果超过long long, 于是用BigInteger, 写这个报告的原因也是第一次用Java交OJ..
代码:
[java]
import java.math.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
BigInteger dp[][]=new BigInteger[101][2];
dp[1][0]=BigInteger.ONE;
dp[1][1]=BigInteger.ZERO;
for(int i=2;i<=100;i++) {
dp[i][0]=dp[i-1][0].add(dp[i-1][0]).add(dp[i-1][1]);
dp[i][1]=dp[i-1][0].add(dp[i-1][1]);
}
Scanner sc=new Scanner(System.in);
while(sc.hasNext()) {
int a=sc.nextInt();
System.out.println(dp[a][0].add(dp[a][1]));
}
}
}
[/java]
References:
Peter Sellers Filme circus circus las vegas buffet
References:
Bethlehem pa casino adhe.com.br
References:
Legiano Casino Live Chat cruises.ruscruiz.ru
References:
Legiano Casino sicher https://www.beamng.com/proxy.php?link=https://bybio.co/emma158460
References:
Legiano Casino Web App https://autoitscript.com
References:
Legiano Casino Alternative http://zip.2chan.net/bin/jump.php?http://images.google.com.sg/url?sa=t&url=http://de.trustpilot.com/review/der-wikinger-shop.de
References:
Legiano Casino Auszahlungslimit http://toolbarqueries.google.com.pe/url?sa=t&url=https://www.comic-rocket.com/go?uri=https://de.trustpilot.com/review/der-wikinger-shop.de
References:
Legiano Casino Code http://images.google.nl
References:
Legiano Casino Einzahlung https://politicalforum.com/proxy.php?link=https://de.trustpilot.com/review/edelkranz.de
References:
Legiano Casino Mindestauszahlung http://www.google.ac
References:
Legiano Casino Bonus https://danieldefo.ru
References:
Legiano Casino Treueprogramm cn.uniview.com