ACM
浙右华亭
这个作者很懒,什么都没留下…
展开
-
[HDU-2612] Find a Way
TLE代码: #include #include #include #include #include #include #include #include using 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 阅读 · 0 评论 -
[UVA-147] Dollars
类型转换:a = int (100*ta+0.5) 防止精度丢失 .......因为这个WA了两次 #include #include #include #include using 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 阅读 · 0 评论 -
[HDU-1069]Monkey and Banana
#include #include #include #include using 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 阅读 · 0 评论 -
[POJ-2387]Til the Cows Come Home
从V到1可以,从1到V会WA,原因分析中 #include #include #include #include #include #include #include using namespace std; const int MAX_V = 1000 + 5; const int INF = 0xffffff; struct edge{ int to, cost;原创 2017-12-20 16:23:54 · 184 阅读 · 0 评论 -
[HDU-1024]Max Sum Plus Plus
#include #include #include using 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 阅读 · 0 评论 -
[POJ 3624]Charm Bracelet
#include #include #include using namespace std; const int maxn = 3402+20; const int maxm = 12880+20; int W[maxn]; // weight int D[maxn]; // desirability int f[2][maxm]; int main() {原创 2017-11-17 15:47:33 · 214 阅读 · 0 评论 -
[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 阅读 · 0 评论 -
[openjudge]百练2755 神奇的口袋
递归算法 #include #include #include #include using 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 阅读 · 0 评论 -
[POJ-2236] Wireless Network
#include #include #include #include #include #include using 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 阅读 · 0 评论 -
[HDU-1213]How Many Tables
#include #include #include #include #include #include #include #include #include using 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 阅读 · 0 评论 -
[POJ-2236] The Suspects
#include #include #include #include #include #include #include #include #include using 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 阅读 · 0 评论 -
[POJ-3414]Pots
#include #include #include #include #include #include #include #include #include using 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 阅读 · 0 评论 -
[HDU-1114]Piggy-Bank
完全背包 #include #include #include #include using 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 阅读 · 0 评论