2012年5月21日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1150二分图最大匹配,匈牙利算法View Code #include #include const int MAX1=101;const int MAX2=1001;int k,m,n;int match[MAX1... 阅读全文
posted @ 2012-05-21 17:55 LegendaryAC 阅读(134) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1063依然是高精度,和上一题很像,不过用上一题的方法一直超时?颇为费解。查了几个函数的用法,直接用函数操作就不超时了?这题mark一下以后还要再看,对超时表示不太理解。stripTrailingZeros()是去掉后缀0,toPlainString()是转成非指数型的字符串(上一题要知道这两个函数直接秒杀了哈。。。)。startsWith("//字符串1")判断给定字符串是否以字符串1开头(对应的还有endsWith())。substring()的用法参考百度百科,看一眼就明白了:&quo 阅读全文
posted @ 2012-05-21 11:38 LegendaryAC 阅读(140) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1753在小数点存在的情况下去掉后面的0View Code import java.io.*;import java.math.*;import java.util.*;import java.text.*;public class Main{ public static void main(String[] args) { Scanner cin=new Scanner (new BufferedInputStream(System.in)); BigDecimal a... 阅读全文
posted @ 2012-05-21 10:38 LegendaryAC 阅读(146) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1047大数View Code import java.io.*;import java.math.*;import java.util.*;import java.text.*;public class Main{ public static void main(String[] args) { Scanner cin=new Scanner (new BufferedInputStream(System.in)); BigInteger sum,a; i... 阅读全文
posted @ 2012-05-21 10:09 LegendaryAC 阅读(112) 评论(0) 推荐(0) 编辑