自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 [POJ-2387]Til the Cows Come Home

从V到1可以,从1到V会WA,原因分析中#include#include#include#include#include#include#includeusing namespace std;const int MAX_V = 1000 + 5;const int INF = 0xffffff;struct edge{ int to, cost;

2017-12-20 16:23:54 184

原创 [HDU-1114]Piggy-Bank

完全背包#include#include#include#includeusing namespace std;const int maxn = 10000 + 22;const int inf = 0x3f3f3f3f;int p[maxn], w[maxn];int dp[maxn];int main() { int T; cin >> T; whil

2017-12-18 16:37:52 206

原创 [UVA-147] Dollars

类型转换:a = int (100*ta+0.5) 防止精度丢失.......因为这个WA了两次#include#include#include#includeusing namespace std;const int maxn = 30000 + 10;long long dp[maxn];int P[12] = {0,5,10,20,50,100,200,

2017-12-07 16:50:01 214

原创 [HDU-1069]Monkey and Banana

#include#include#include#includeusing namespace std;const int maxn = 30*6 + 20;struct Node { int x, y, z;};Node S[maxn];int dp[maxn];bool cmp( Node a, Node b ) { if( a.x<b.x ) {

2017-12-05 16:27:33 212

原创 [HDU-1024]Max Sum Plus Plus

#include#include#includeusing namespace std;const int maxn = 1000000 + 10;const int INF = 0X7fffffff;int S[maxn];int dp[maxn][2];int main() { int m, n; while( scanf("%d%d", &m, &n)!=

2017-11-21 23:39:50 167

原创 [POJ 3624]Charm Bracelet

#include#include#includeusing namespace std;const int maxn = 3402+20;const int maxm = 12880+20;int W[maxn]; // weightint D[maxn]; // desirabilityint f[2][maxm];int main() {

2017-11-17 15:47:33 214

原创 [HDU-3038] How Many Answers Are Wrong

#include #include #include #include using namespace std;const int maxn = 200000 + 20;int parent[maxn];int sum[maxn];int dis;int GetParent(int a) { if( a != parent[a] ) { int t

2017-11-07 10:39:47 233

转载 [openjudge]百练2755 神奇的口袋

递归算法#include#include#include#includeusing namespace std;int a[30]; int N;int Ways( int w, int k ) { if( w==0 ) { return 1; } if( k<=0 ) { return 0; } return Ways(w, k-1) + Ways

2017-10-20 14:37:22 321

原创 [HDU-1213]How Many Tables

#include#include#include#include#include#include#include#include#includeusing namespace std;const int maxn = 1000 + 10;int parent[maxn];int ans;int GetParent(int a) { if( parent[a

2017-09-29 16:01:49 175

原创 [POJ-2236] The Suspects

#include#include#include#include#include#include#include#include#includeusing namespace std;const int maxn = 30000 + 20;int parent[maxn];int member[maxn];int GetParent(int a) { i

2017-09-29 15:27:09 197

原创 [POJ-2236] Wireless Network

#include#include#include#include#include#includeusing namespace std;const int maxn = 1001 + 20;int parent[maxn];bool open[maxn];struct Node{ int x; int y; Node(int xx, int yy

2017-09-22 16:43:34 236

原创 [POJ-3414]Pots

#include#include#include#include#include#include#include#include#includeusing namespace std;const int maxn = 100 + 12;struct Node { int a, b; int t; int s, f; Node(int aa,

2017-09-01 16:48:25 238

原创 [HDU-2612] Find a Way

TLE代码:#include#include#include#include#include#include#include#includeusing namespace std;int Next[4][2] = { {0,1}, {0,-1}, {1,0}, {-1,0} };struct Pos{ int x, y; Pos(int xx, int

2017-08-09 21:55:01 224

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除