Matches UVA 11375
来源:互联网 发布:mac桌面便签软件 编辑:程序博客网 时间:2024/05/22 23:51
第一次用java,真心不错,感谢林威同学给我装的java虚拟机和Eclipse
import java.math.BigInteger;import java.util.Scanner;public class Main { static int MAXN = 2010; public static void main(String[] args){ int ts; int opt[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; BigInteger table[] = new BigInteger[MAXN]; BigInteger one = new BigInteger("1"); for(int i = 0; i <= MAXN-1; ++i) table[i] = new BigInteger("0"); for(int i = 1; i <= 9; ++i) table[opt[i]] = table[opt[i]].add(one); for(int i = 1; i <= 2000; ++i) for(int j = 0; j <= 9; ++j) table[i+opt[j]] = table[i+opt[j]].add(table[i]); table[6] = table[6].add(one); for(int i = 1; i <= 2000; ++i) table[i] = table[i].add(table[i-1]); Scanner sc = new Scanner(System.in); while(sc.hasNextInt()){ ts = sc.nextInt(); System.out.println(table[ts]); } } }
- Matches UVA 11375
- uva 11375 - Matches
- UVA 11375 - Matches
- UVA 11375 - Matches
- UVA - 11375 Matches
- UVa:11375 Matches
- UVa 11375 Matches
- UVa 11375 Matches
- Matches(uva 11375)
- UVa 11375 Matches (DP&高精度)
- uva 11375 - Matches(递推)
- UVA - 11375-Matches-dp+高精度
- Matches UVA
- UVA 11375 Matches(递推)
- UVA 11375 Matches (dp+高精度)【模板】
- UVA 11375 - Matches (数学——递推)
- Uva 11375 Matches 解题报告(递推+高精度)
- UVa 11375 - Matches (递推 JAVA 高精度)
- Lucene学习笔记(一)——入门示例
- POJ 2465 Adventures in Moving - Part IV
- 【C++】排序算法
- android内核字符驱动设备实战之----------应用层测试程序篇
- GNU C与ANSI C (1)
- Matches UVA 11375
- u盘文件系统问题
- 超级牛人在华为工作十年的感悟
- WPF中Listbox使用
- 让javascript显原型!
- svn 仓库的创建和删除
- 正则表达式将字符串中的所有连续空格替换成一个空格
- c#开发ActiveX完全攻略
- c++ 引用的理解