
模板
文章平均质量分 80
弱菜zc
打完这场就回老家结婚!
展开
-
dijkstra模板
#include#include#include#include#include#includeusing namespace std;const int maxn=30000+5; struct Edge{ int from,to,weight; Edge(int from,int to,int weight):from(from),to(to),weight(weight)转载 2017-06-15 19:43:36 · 420 阅读 · 0 评论 -
【2017新疆网络赛】H Skiing 最短路径spfa 模版
In this winter holiday, Bob has a plan for skiing at the mountain resort.This ski resort has MM different ski paths and NN different flags situated at those turning points.The ii-th path fro原创 2017-09-15 20:38:40 · 665 阅读 · 0 评论 -
【多校训练】hdu 6085 Rikka with Candies bitset
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:There are n children and m ki原创 2017-08-30 17:32:05 · 512 阅读 · 0 评论 -
【2017广西邀请赛】hdu 6184 Counting Stars 三元环+set
Problem DescriptionLittle A is an astronomy lover, and he has found that the sky was so beautiful!So he is counting stars now!There are n stars in the sky, and little A has connected them原创 2017-09-08 20:37:26 · 870 阅读 · 0 评论 -
【2017青岛网络赛】1009 Smallest Minimum Cut hdu6214 最小割 最大流模版
Problem DescriptionConsider a network G=(V,E) with source s and sink t. An s-t cut is a partition of nodes set V into two parts such that s and t belong to different parts. The cut set i原创 2017-09-18 20:55:20 · 1071 阅读 · 0 评论 -
【2013南京现场赛】1003 hdu4804 Campus Design 插头dp
Problem DescriptionNanjing University of Science and Technology is celebrating its 60th anniversary. In order to make room for student activities, to make the university a more pleasant place for原创 2017-09-11 19:19:44 · 550 阅读 · 0 评论 -
UVALive 7139 Rotation 二维vector+矩阵前缀和 【模版】
题目大意:给一个n*m的矩阵,每个方块上有一个人。现在有一辆车在左上角的格点处,矩阵里的人都会一直面向那辆车。现在给出车的移动路线,问每个人总旋转角度的平方和是多少。若一个人顺时针旋转10个圈,逆时针旋转15个圈,最终算旋转角度为5个圈。思路:根据题意,车一定会回到原点,那么每个人的初始面向方向与最终面向方向相同,每个人旋转的圈数都必将是整数。若车在人的正左方下降了X次,上升了Y次,那么那原创 2017-10-03 22:26:21 · 575 阅读 · 0 评论 -
hdu 4777 Rabbit Kingdom 树状数组
Problem Description Long long ago, there was an ancient rabbit kingdom in the forest. Every rabbit in this kingdom was not cute but totally pugnacious, so the kingdom was in chaos in season and o原创 2017-07-02 10:02:31 · 688 阅读 · 0 评论 -
hdu 4778 Gems Fight! 状压dp+博弈
Problem Description Alice and Bob are playing "Gems Fight!": There are Gems of G different colors , packed in B bags. Each bag has several Gems. G different colors are numbered from color 1 to原创 2017-06-29 21:42:14 · 464 阅读 · 0 评论 -
【2017新疆网络赛】F Islands 强连通分量tarjan hdu2767原题
On the mysterious continent of Tamriel, there is a great empire founded by human.To develope the trade, the East Empire Company is set up to transport goods from place to place.Recently, the compa原创 2017-09-15 19:29:01 · 746 阅读 · 0 评论 -
【2017沈阳网络赛】1003 hdu6196 happy happy happy 暴搜+区间dp+卡时优化
Problem DescriptionToday, Bob plays with a child. There is a row of n numbers. One can takes a number from the left side or the right side in turns and gets the grade which equals to the number.原创 2017-09-13 15:34:19 · 766 阅读 · 0 评论 -
【多校训练】hdu 5730 cdq+fft
Shell NecklaceTime Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1089 Accepted Submission(s): 467Problem DescriptionPerhaps the原创 2017-06-22 21:27:03 · 665 阅读 · 0 评论 -
51nod 1086 背包问题 V2 多重背包
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1086题意:有N种物品,每种物品的数量为C1,C2......Cn。从中任选若干件放在容量为W的背包里,每种物品的体积为W1,W2......Wn(Wi为整数),与之相对应的价值为P1,P2......Pn(Pi为整数)。求背包能够容纳的最大价值。标准的原创 2016-05-20 23:32:34 · 823 阅读 · 0 评论 -
hdu 4115 Eliminate the Conflict 2-sat
Problem DescriptionConflicts are everywhere in the world, from the young to the elderly, from families to countries. Conflicts cause quarrels, fights or even wars. How wonderful the world will be原创 2017-07-03 18:42:33 · 415 阅读 · 0 评论 -
POJ 3422 Kaka's Martix Travels 费用流模板
On an N × N chessboard with a non-negative number in each grid, Kaka starts his matrix travels with SUM = 0. For each travel, Kaka moves one rook from the left-upper grid to the right-bottom one, taki原创 2017-06-24 21:29:05 · 536 阅读 · 0 评论 -
hdu 5724 Chess SG函数
ChessTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2547 Accepted Submission(s): 1064Problem DescriptionAlice and Bob are playin原创 2017-05-29 19:00:02 · 488 阅读 · 0 评论 -
hihocoder 1162 : 骨牌覆盖问题·三 矩阵快速幂
描述前两周里,我们讲解了2xN,3xN骨牌覆盖的问题,并且引入了两种不同的递推方法。这一次我们再加强一次题目,对于给定的K和N,我们需要去求KxN棋盘的覆盖方案数。提示:KxN骨牌覆盖输入第1行:2个整数N。表示棋盘宽度为k,长度为N。2≤K≤7,1≤N≤100,000,000输出第1行:1个整数,表示覆盖方案数 MOD 12357Sample原创 2017-06-27 14:50:27 · 635 阅读 · 1 评论 -
【多校训练】hdu 6178 Monkeys 贪心+dfs+读入挂模版
Problem DescriptionThere is a tree having N vertices. In the tree there are K monkeys (K <= N). A vertex can be occupied by at most one monkey. They want to remove some edges and leave minimum edg原创 2017-08-25 21:43:25 · 642 阅读 · 0 评论 -
你真的会二分查找吗?
引用请注明出处:http://blog.youkuaiyun.com/int64ago/article/details/7425727 看到这个标题无论你是处于怎样的心理进来看了,我觉得都是值得的。因为这个问题太简单,任何一个开始接触“真正”算法基本都是从二分查找开始的。至于二分查找都不知道是什么的可以先去找别的资料看下,再来看这篇文章。既然很简单,那么我们开始一起写一个吧,要转载 2017-08-26 15:12:41 · 454 阅读 · 0 评论 -
输入输出挂模板
可用于正负数(int , long long , float , double)template bool scan_d(T &ret){ char c; int sgn; T bit = 0.1; if (c=getchar(), c==EOF) { return 0; } while (c! = '-' &&原创 2017-06-15 19:53:59 · 552 阅读 · 0 评论