上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 47 下一页

2012年5月20日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1134在上一题的基础上加个-1跳出的判断、、、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)); BigInteg... 阅读全文
posted @ 2012-05-20 23:53 LegendaryAC 阅读(193) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1130和上一题一模一样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[] f=new B... 阅读全文
posted @ 2012-05-20 23:43 LegendaryAC 阅读(318) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1023卡特兰数,要注意是大数,直接学着用java搞大数了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)); Big... 阅读全文
posted @ 2012-05-20 23:40 LegendaryAC 阅读(152) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2063二分图最大匹配,参照白书上邻接表建的图View Code #include #include const int MAX1=501;const int MAX2=1001;int k,m,n;int matc... 阅读全文
posted @ 2012-05-20 15:56 LegendaryAC 阅读(115) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2164剪刀石头布,无脑模拟View Code #include <stdio.h>int gao(char p1,char p2){ if(p1=='S'&&p2=='P')return 1; if(p1=='P'&&p2=='R')return 1; if(p1=='R'&&p2=='S')return 1; if(p2=='S'& 阅读全文
posted @ 2012-05-20 14:01 LegendaryAC 阅读(182) 评论(0) 推荐(0) 编辑

2012年5月19日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1280hash+最大堆,STL堆View Code #include <iostream>#include <map>#include <vector>#include <queue>#include <cstring>using namespace std;int hash[10001];int main(){ int n,m; priority_queue <int> q; while(~scanf("%d%d", 阅读全文
posted @ 2012-05-19 23:28 LegendaryAC 阅读(318) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1029看题意就是建立一个映射,用map直接过View Code #include <iostream>#include <map>using namespace std;int main(){ int n; while(~scanf("%d",&n)) { map <int ,int > M; int bz=(n+1)/2; while(n--) { int a; scanf("%d",&a)... 阅读全文
posted @ 2012-05-19 19:08 LegendaryAC 阅读(237) 评论(0) 推荐(0) 编辑

2012年5月14日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1259水题View Code #include <stdio.h>#include <string.h>int main(){ int n,m,x,y,i,a[10]; scanf("%d",&n); while(n--) { memset(a,0,sizeof(a)); a[2]=1; scanf("%d",&m); while(m--) { scanf("%d%d",&x,&y); ... 阅读全文
posted @ 2012-05-14 20:32 LegendaryAC 阅读(170) 评论(0) 推荐(0) 编辑

2012年5月13日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2066裸最短路,一开始又sb了,处理错复杂度TLE,囧View Code #include #include const int INF=1000000001;const int maxn=1001;int G[m... 阅读全文
posted @ 2012-05-13 22:57 LegendaryAC 阅读(250) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1596最短路ps:0可以理解为那两个城市之间没有直接的通道,少看了这个条件错惨,在sx和zbw两位祖先的帮助下认清了这个问题#include #include using namespace std;const d... 阅读全文
posted @ 2012-05-13 17:22 LegendaryAC 阅读(486) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 47 下一页