uva10198 Counting
2012-09-25 11:52
190 查看
//规律 test =2*test[n-1]+test[n-2]+test[n-3] //第一次用java写代码 感觉挺别扭 大数运算。 import java.math.*; import java.util.Scanner; public class Main { public static void main(String args[]){ BigInteger test[]; test=new BigInteger[1002]; test[1]=new BigInteger("2"); test[2]=new BigInteger("5"); test[3]=new BigInteger("13"); for(int i=4;i<=1000;i++){ BigInteger ans=((test[i-1].add(test[i-1])).add(test[i-2])).add(test[i-3]);//公式 test[i]=ans; } Scanner cin=new Scanner(System.in); int n; while(cin.hasNext()){ n=cin.nextInt(); System.out.println(test ); } } }
相关文章推荐
- uva - 10198 - Counting
- UVa 10198 - Counting
- UVA 10198 Counting
- UVa Problem Solution: 10198 - Counting
- UVa Problem 10198 Counting (数数)
- UVA 10198 Counting
- UVA - 494 Kindergarten Counting Game
- UVA - 1225 Digit Counting
- UVA - 1225 Digit Counting
- UVA 494 Kindergarten Counting Game
- UVa 494 Kindergarten Counting Game (字符串处理)
- UVa 10198 Counting (组合数学&高精度)
- HDOJ 3664 Permutation Counting / UVALive 5092 DP
- 数学专项counting:UVa 10128
- uva 10516 - Another Counting Problem(dp)
- UVa 1225 Digit Counting (枚举)
- UVA 494 Kindergarten Counting Game
- UVa 1640 (计数) The Counting Problem
- 算法竞赛入门经典第三章3-3 Digit Counting UVA - 1225
- UVa1225-Digit Counting