自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

不慌不忙、不急不躁

https://github.com/JeraKrs

  • 博客(122)
  • 收藏
  • 关注

原创 【索引】2015 Multi-University Training Contest

Multi-University Training Contest 1Problem 1001: hdu 5288 OO’s SequenceProblem 1002: hdu 5289 AssignmentProblem 1003: hdu 5290 Bombing planProblem 1004: hdu 5291 Candy DistributionProb

2015-11-30 15:13:42 1180 1

原创 hdu 4629 Burning(离散化)

题目链接:hdu 4629 Burning代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const double eps = 1e-10;inline int dcmp(double e) { if (fabs(e) < eps) return 0;

2015-11-17 10:43:39 770

原创 hdu 5565 Clarke and baton(水)

题目链接:hdu 5565 Clarke and baton代码#include <cstdio>#include <cstring>#include <queue>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 1e7 + 1;const int mod = 1e9 + 7;c

2015-11-16 18:14:06 789 6

原创 hdu 5564 Clarke and digits(矩阵快速幂)

题目链接:hdu 5564 Clarke and digits解题思路(i,j)表示该位为i并且取模7为j的种数。根据k构造一个70*70的矩阵代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 75;const

2015-11-16 18:13:02 1167

原创 hdu 5563 Clarke and five-pointed star(几何)

题目链接:hdu 5563 Clarke and five-pointed star代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const double eps = 1e-4;struct Point { double x, y; Po

2015-11-16 18:10:35 627

原创 hdu 5562 Clarke and food(水)

题目链接:hdu 5562 Clarke and food代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 1e5 + 5;int N, W[maxn], V;int main () { int cas; scanf("%d", &cas);

2015-11-16 18:09:29 999

原创 hihoCoder 1259 A Math Problem(数位dp)

题目链接:hihoCoder 1259 A Math Problem解题思路公式推导完为f(2n) = 3 * f(n), f(2n+1) = 3 * f(n) + 1,即为i的2进制作为3进制计算贡献。代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;ty

2015-11-16 15:48:18 1708 1

原创 hihoCoder 1258 Osu! Master(水)

题目链接:hihoCoder 1258 Osu! Master代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int main () { int n, c; char order[5]; while (scanf("%d", &n) == 1) { i

2015-11-16 15:45:51 695

原创 hihoCoder 1257 Snake Carpet(构造)

题目链接:hihoCoder 1257 Snake Carpet代码#include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;typedef pair<int,int> pii;char ans[5][100] = { "1 1\n1 1", "1 3\n1 1\n1

2015-11-16 15:44:41 818

原创 hihoCoder 1255 Mysterious Antiques in Sackler Museum(水)

题目连接:hihoCoder 1255 Mysterious Antiques in Sackler Museum代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 10;int X[maxn], Y[maxn];bool solve(int* x, int*

2015-11-16 15:43:18 1025

原创 hihoCoder 1251 Today Is a Rainy Day(暴力)

题目连接:hihoCoder 1251 Today Is a Rainy Day解题思路用一个6位6进制表示每个数对应的转换,用广搜预处理代价。代码#include <cstdio>#include <cstring>#include <queue>#include <algorithm>using namespace std;const int maxn = 50005;const in

2015-11-16 15:41:28 1625 1

原创 hihoCoder 1249 Xiongnu's Land(二分)

题目链接:hihoCoder 1249 Xiongnu’s Land代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 10005;int N, R, L[maxn], T[maxn], W[maxn], H[max

2015-11-16 15:38:57 1347

原创 【索引】2013 Multi-University Training Contest

2013 Multi-University Training Contest 1Problem 1001: hdu 4600 Harvest MoonProblem 1002: hdu 4601 Letter TreeProblem 1003: hdu 4602 PartitionProblem 1004: hdu 4603 Color the TreeProblem 10

2015-11-14 21:31:34 1183

原创 zoj 3732 Graph Reconstruction(构造)

题目链接:zoj 3732 Graph Reconstruction解题思路用贪心的方式取构造即可。代码/* hdu4797 */#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef pair<int,int> pii;const int maxn = 105;int N, E,

2015-11-14 21:29:49 766

原创 hdu 5559 Frog and String(构造)

题目链接:hdu 5559 Frog and String解题思路n < m:impossiblen = m:用全A构造n > m: k = 1:impossiblek = 2:用 AAAA….(m-8个A) + ABAABB ABAA…k > 3:用 AAAA….(m-3个A) + ABC ABC ABC … 特殊情况n = 8, m = 7, k = 2。 原则上是找到一种构造方

2015-11-14 21:27:17 1571 2

原创 hdu 5556 Land of Farms(二分图匹配)

题目链接:hdu 5556 Land of Farms解题思路枚举哪些位置是重建的,重建的周围位置不能用,其他空地用做二分图匹配最大独立集。代码#include <cstdio>#include <cstring>#include <cstdlib>#include <vector>#include <algorithm>using namespace std;typedef pair<i

2015-11-14 21:22:23 1675

原创 hdu 5555 Immortality of Frog(状压dp)

题目链接:hdu 5555 Immortality of Frog解题思路因为每只青蛙最多碰到10个bad的membrane,所以可以用一个二进制状态表示到第i只青蛙还有哪些membrane可以选,但是二进制的状态的转移必须预处理,因为每只青蛙对应的bad membrane是不一样的。注意对于第i个位置来说,有membrane以这个位置终止,但是并没有被用掉则是非法的。剩下的good membran

2015-11-14 21:17:15 1652 2

原创 hdu 4801 Pocket Cube(暴力)

题目链接:hdu 4801 Pocket Cube代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 24;int rot[6][maxn] = {{6, 1, 12, 3, 5, 11, 16, 7, 8, 9, 4, 10, 18, 13, 14, 15

2015-11-14 21:11:21 712

原创 hdu 4800 Josephina and RPG(dp)

题目链接:hdu 4800 Josephina and RPG代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 10005;const int maxm = 125;int M;double G[maxm][maxm], dp[maxn][maxm];d

2015-11-14 21:10:01 522

原创 hdu 4799 LIKE vs CANDLE(树形dp)

题目链接:hdu 4799 LIKE vs CANDLE解题思路dp[i][0]表示第i个节点不翻转的最优解,dp[i][1]表示翻转的最优解,每个位置翻转的代价到其父亲节点的位置再计算。代码#include <cstdio>#include <cstring>#include <cmath>#include <vector>#include <algorithm>using namespa

2015-11-14 21:08:49 708

原创 hdu 4798 Skycity(几何)

题目链接:hdu 4798 Skycity代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const double pi = 4 * atan(1.0);int F;double R, L, H, S;double solve (double r, do

2015-11-14 21:06:23 711

原创 hdu 4793 Collision(几何)

题目链接:hdu 4793 Collision代码#include <cstdio>#include <cstring>#include <cmath>#include <vector>#include <algorithm>using namespace std;const double pi = 4 * atan(1);const double eps = 1e-6;inline i

2015-11-14 21:05:11 474

原创 hdu 4791 Alice's Print Service(贪心)

题目链接:hdu 4791 Alice’s Print Service代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 1e5 + 5;int N, M, S[maxn], P[maxn];ll W[maxn];

2015-11-14 21:03:15 891 1

原创 hdu 4685 Prince and Princess(二分图匹配 + 强连通)

题目链接:hdu 4685 Prince and Princess解题思路K为当前最大匹配数,王子增加M-K个虚拟点用来匹配没有配对成功的公主,公主增加N-K的虚拟点用来匹配没有配对成功的王子,然后从公主建一条反向边到其配对的王子,做一次强连通,属于同一联通分量的王子和公主可以配对。代码#include <cstdio>#include <cstring>#include <vector>#i

2015-11-13 11:11:42 796

原创 hdu 4652 Dice(dp)

题目链接:hdu 4652 Dice代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int maxn = 1e6 + 5;/* * k = 0, 设dp[i]表示连续出现i的一样的次数期望 * 设xi = dp[i] - dp[i-1]

2015-11-13 11:08:15 599

原创 hdu 4681 String(LIS+暴力)

题目连接:hdu 4681 String代码#include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;typedef pair<int,int> pii;const int maxn = 1005;int N, M, K, l[maxn][maxn], r[maxn

2015-11-12 21:47:11 632

原创 hdu 4641 K-string(后缀自动机 + 并查集)

题目链接:hdu 4641 K-string代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 300005;const int SIGMA_SIZE = 26;struct SAM { int sz, l

2015-11-12 21:45:48 1010

原创 hdu 4628 Pieces(状压dp)

题目链接:hdu 4628 Pieces代码#include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;const int maxn = 20;const int maxs = (1<<16) + 6;const int inf = 0x3f3f3f3f;int N

2015-11-12 21:44:27 672

原创 hysbz 2038 小Z的袜子(莫队)

题目链接:hysbz 2038 小Z的袜子代码#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 50005;struct State { int l, r, id;}Q[ma

2015-11-12 15:18:43 896

原创 poj 1330 Nearest Common Ancestors(LCA)

题目链接:poj 1330 Nearest Common Ancestors代码#include <cstdio>#include <cstring>#include <vector>#include <queue>#include <algorithm>using namespace std;const int maxn = 1e4 + 5;const int inf = 0x3f3f

2015-11-12 15:15:36 418

原创 hdu 2586 How far away ?(LCA)

题目链接:hdu 2586 How far away ?代码#include <cstdio>#include <cstring>#include <vector>#include <queue>#include <algorithm>using namespace std;typedef pair<int,int> pii;const int maxn = 40005;const i

2015-11-12 15:13:50 381

原创 hdu 2874 Connections between cities(LCA)

题目链接:hdu 2874 Connections between cities代码#include <cstdio>#include <cstring>#include <vector>#include <queue>#include <algorithm>using namespace std;typedef pair<int,int> pii;const int maxn = 10

2015-11-12 15:12:31 411

原创 hdu 4115 Eliminate the Conflict(2SAT)

题目链接:hdu 4115 Eliminate the Conflict代码#include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;const int maxn = 10005;struct TwoSAT { int n, s[maxn<<1], c;

2015-11-12 15:10:27 465

原创 hdu 4705 Y(计数)

题目链接:hdu 4705 Y代码#pragma comment(linker, "/STACK:16777216") #include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;typedef unsigned long long ll;const int max

2015-11-12 14:50:04 577

原创 hdu 4704 Sum(数论)

题目链接:hdu 4704 Sum解题思路费马小定理,指数的循环节为mod-1代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int mod = 1e9 + 7;const int maxn = 1e5 + 5;struct big

2015-11-12 14:49:03 647

原创 hdu 4701 Game(博弈)

题目链接:hdu 4701 Game代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;const int maxn = 1e6 + 5;/* * S(i) 表示第i件物品到第N件物品的价值和 * win(i, x, y) 表示当前可以买的物品

2015-11-12 14:47:14 758

原创 hdu 4700 Flow (构造)

题目链接:hdu 4700 Flow 解题思路每次取找到权值最小的边,然后根据这条边将点集分成两个部分,保证不同点集的点之间流量为最小权值,同点集之间流量大于最小权值。然后再分别构造这两个集合。代码#include <cstdio>#include <cstring>#include <vector>#include <algorithm>using namespace std;const

2015-11-12 14:46:07 719

原创 hdu 4699 Editor(单调栈)

题目链接:hdu 4699 Editor解题思路光标前后各用一个栈维护即可代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 1e6 + 5;struct Stack { int n, s[maxn]; void init() { n = 0;

2015-11-12 14:43:27 679

原创 hdu 4698 Counting(计数)

题目链接:hdu 4698 Counting解题思路考虑不可行的四元组,用所有方案数减掉。将x按照坐标排序,保证某些x满足时,对应的y不满足,累加求和。代码#include <cstdio>#include <cstring>#include <set>#include <algorithm>using namespace std;typedef set<int>::iterator ite

2015-11-12 14:41:40 636

原创 hdu 4696 Answers(规律)

题目链接:hdu 4696 Answers解题思路只要存在一个c为1的即所有m大于0的都可以构成,如果不存在c为1,则m为大于0的偶数可以构成代码#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int main () { int n, m; while (scanf("%d%d"

2015-11-12 14:38:47 703

空空如也

空空如也

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

TA关注的人

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