- 博客(39)
- 收藏
- 关注
转载 scu 4284 Windy's Job
http://cstest.scu.edu.cn/soj/problem.action?id=42844284: Windy's JobSubmit your solutionDiscuss this problemBest solutionsDescriptionWindy has N jobs, the i-th job...
2013-05-02 15:35:00
117
转载 poj 1979(dfs)
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int dx[]={0,1,-1,0};const int dy[]={1,0,0,-1};const int maxn = 25;bool vis[maxn]...
2013-03-30 00:06:00
105
转载 Codeforces 196B
//题意描述,给你一张最大1500*1500的图,途中的S称为起点,图可以无限延伸,意思是能够将图能够无限平移,最后让你判断,从起点处能否到达无穷远;//思路,如果一个图能从起点到达无穷远,一定能从图的任意一点到达下一张图与原图对应的点。那么代码就很好写了。 1 #include <cstdio> 2 #include <queue> ...
2013-03-26 13:06:00
111
转载 hdu 2609(最小表示法)
How manyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 914Accepted Submission(s): 350 Problem DescriptionGive you n ( n < 10...
2013-03-04 21:11:00
111
转载 hdu 4190(二分搜索)
Distributing Ballot BoxesTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 423Accepted Submission(s): 228 Problem DescriptionT...
2013-02-14 21:13:00
163
转载 hdu 1597
1 #include<stdio.h> 2 #include<iostream> 3 #include<math.h> 4 using namespace std; 5 typedef __int64 ll; 6 int main() 7 { 8 int t,ans; 9 scanf("%d",&a...
2012-11-22 21:48:00
74
转载 hdu 1575(矩阵乘法)
#include<stdio.h>#include<string.h>const int mod = 9973;#define maxn 15struct matrix{ int arr[maxn][maxn];};matrix mul(struct matrix a,struct matrix b,int n){...
2012-11-21 17:16:00
137
转载 hdu 1047(java)
1 import java.io.*; 2 import java.text.*; 3 import java.math.*; 4 import java.util.*; 5 public class Main { 6 7 /** 8 * @param args 9 */10 public static vo...
2012-11-15 14:51:00
103
转载 bnuoj 4122
北师大ACM新手指导第十二题-高精度乘法应用Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 65536 KBSubmit: 150 Accepted: 54 [Prev][Next]Description正式比赛时,高精度乘法的题目一般都有较大的变形,选手应该充分理解...
2012-11-14 19:05:00
98
转载 hdu 1715(java)
import java.io.*;import java.math.*;import java.util.*;public class Main { /** * @param args */ public static void main(String[] args) { // TODO 自动生成的方法存根 Scanner cin = ...
2012-11-14 16:13:00
62
转载 hdu 1878(并查集判断连通)
1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 #define maxn 1005 6 int fa[maxn],degree[maxn]; 7 8 int findfather(int x...
2012-11-02 16:24:00
84
转载 poj 3009(dfs)
Curling 2.0Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7356Accepted: 3069DescriptionOn Planet MM-21, after their Olympic games this year, curl...
2012-10-29 19:46:00
89
转载 poj 2488(简单dfs,注意方向)
A Knight's JourneyTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 22306Accepted: 7546DescriptionBackground The knight is getting bored of seeing...
2012-10-28 20:46:00
79
转载 hdu 1175(连连看bfs)
连连看Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10550Accepted Submission(s): 2805Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面...
2012-10-17 21:08:00
74
转载 hdu 1003(最大连续子序列和)
Max SumTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 87019Accepted Submission(s): 20165Problem DescriptionGiven a sequen...
2012-10-14 21:31:00
66
转载 hdu 1018(斯特林公式)
#include<stdio.h>#include<math.h>#define PI 3.1415926535898#define e 2.7182818284590 int main(){int t,n;double ans;scanf("%d",&t);while(t--){scanf("%d",&n);ans=l...
2012-10-09 21:09:00
110
转载 hdu 1181 (dfs)
变形课Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 7187Accepted Submission(s): 2673Problem Description呃......变形课上Harry碰到了一点小麻烦,因...
2012-09-25 20:23:00
73
转载 hdu 2071
一道很水的题,我把它用线段树来写的,算是一看点吧#include<stdio.h>#define maxn 105double sum[maxn<<2];double max(double a,double b){ if(a>b) return a; else return b...
2012-09-24 20:10:00
67
转载 poj 3468(线段树,区间加减,延迟操作)
A Simple Problem with IntegersTime Limit: 5000MSMemory Limit: 131072KTotal Submissions: 36129Accepted: 10381Case Time Limit: 2000MSDescriptionYou h...
2012-09-14 20:40:00
77
转载 hdu 1698(线段树,延迟操作,区间更新)
Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9758Accepted Submission(s): 4776Problem DescriptionIn the game of DotA...
2012-09-14 09:23:00
89
转载 hdu 2795
BillboardTime Limit: 20000/8000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4947Accepted Submission(s): 2294Problem DescriptionAt the entrance to t...
2012-09-04 21:43:00
59
转载 hdu 1754(线段树,点更新,区间最大值)
I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18019Accepted Submission(s): 6947Problem Description很多学校流行一种比较的习惯。老师们很喜欢...
2012-08-16 18:10:00
71
转载 hdu 1166(线段树,单点更新)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18917Accepted Submission(s): 8234Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国...
2012-08-16 15:41:00
45
转载 矩阵快速幂
一般涉及矩阵求幂的问题都要求很大的幂,需要快速求出,这就使人想到了二分法。想到二分法后,首先想到递归:____ DFS(int a){ ____ ret1; if(a==1) return G2; ret1=DFS(a/2); ret1=Cheng(ret1,ret1); if(a%2)ret1=Cheng(ret1,G2);...
2012-08-14 21:50:00
68
转载 hdu 1229
1 #include<stdio.h> 2 int main() 3 { 4 int a,b,k,x,y; 5 int flag,i; 6 while(scanf("%d%d%d",&a,&b,&k)!=EOF) 7 { 8 if(a==0&&b==0)...
2012-08-11 14:08:00
51
转载 hdu 1102
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#define maxn 105#define INF 0x2fffffffint g[maxn][maxn];int vis[maxn];int dis[maxn];...
2012-08-11 11:19:00
51
转载 hdu 2094
1 //只需要判断入度为零的点是不是只有1个就可以了 2 #include<stdio.h> 3 #include<string.h> 4 #include<string> 5 #include<algorithm> 6 #include<map> 7 using namespace std; ...
2012-08-10 20:52:00
73
转载 hdu 1272
/*一道坑爹的水题,表示,你只要判断边数和点数之间的关系是不是edge+1=node,再用并查集判断环就ac了*/#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#define maxn 100005int fa[maxn...
2012-08-10 16:35:00
54
转载 hdu 1032(打表水过)
1 #include<stdio.h> 2 #include<algorithm> 3 using namespace std; 4 #define maxn 1000001 5 __int64 a[maxn]; 6 void init() 7 { 8 __int64 i,temp; 9 __int64 cou...
2012-08-10 14:56:00
82
转载 adjacency list(邻接表)神物
先附上测试数据8 125 8 296 1 128 3 111 2 43 1 224 3 177 4 25 6 5 98 7 71 6 93 2 196 7 48个点12条边#include<stdio.h>#include<string.h>#include<queue>#include<algorithm>...
2012-08-10 10:50:00
271
转载 hdu 2544 (spfa)
spfa的模板,但是,是用邻接表存边的,但是邻接表神物,不懂邻接表的可以去看我的邻接表随笔 1 #include<stdio.h> 2 #include<string.h> 3 #include<queue> 4 #include<algorithm> 5 using namespace std; 6 #defi...
2012-08-09 21:18:00
114
转载 hdu 2503
1 //表示用到了gcd,本身没什么好说的 2 #include<stdio.h> 3 __int64 gcd(__int64 a,__int64 b) 4 { 5 if(b==0) 6 return a; 7 return gcd(b,a%b); 8 } 9 int main() 10 {1...
2012-08-09 20:22:00
64
转载 hdu 2199
1 //二分查找 2 #include<stdio.h> 3 #include<math.h> 4 #define eps 1e-7 5 double fun(double x) 6 { 7 return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6; 8 } 9 double bin_...
2012-08-09 16:55:00
73
转载 hdu 1285
1 //最基础的top排序 2 #include<stdio.h> 3 #include<string.h> 4 #include<algorithm> 5 using namespace std; 6 #define xx 505 7 int g[xx][xx],indegree[xx]; 8 int n,m; ...
2012-08-09 10:08:00
55
转载 hdu 2057
1 #include<stdio.h> 2 int main() 3 { 4 __int64 a,b,ans; 5 while(scanf("%I64X%I64X",&a,&b)!=EOF) 6 { 7 ans=a+b; 8 if(ans<0) 9 ...
2012-08-08 20:24:00
73
转载 hdu 1863
1 //裸的kruskal,如果不会的多看下并查集吧,不多说了 2 #include<stdio.h> 3 #include<string.h> 4 #include<algorithm> 5 using namespace std; 6 #define maxn 100 7 int fa[maxn],rank[maxn]...
2012-08-08 17:24:00
94
转载 hdu 1301
/*kruskal的模板,表示建图那里稍微有一点点麻烦, 我用的map建图,忘记了只有27个字母,也可以用ascii码来建图。*/#include<stdio.h>#include<string.h>#include<map>#include<string>#include<algorithm>usi...
2012-08-08 16:26:00
56
转载 hdu 2078
//我想说的是这题描述有点问题,不清楚,水题就没什么好说的了#include<stdio.h>#define min(x,y)(x)>(y)?(y):(x)int main(){ int t; int n,m,ans,c,i; scanf("%d",&t); while(t--) { ...
2012-08-08 15:12:00
63
转载 hdu 1856
1 //貌似可以用离散化做,本人菜鸟,搞不定,所以大家将就着看吧。 2 #include<stdio.h> 3 #include<string.h> 4 #include<algorithm> 5 using namespace std; 6 #define max(x,y) (x)>(y)?(x):(y) 7 #d...
2012-08-08 14:53:00
100
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人