
杂题
纵马且长歌
贪心过样例,暴力出奇迹,骗分最神奇,打表进省一
展开
-
CodeForces785C_Anton and Fairy Tale
C. Anton and Fairy Taletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton likes to listen to fairy tales原创 2017-03-29 20:35:01 · 395 阅读 · 0 评论 -
hdu5980_Find Small A_思维
Problem DescriptionAs is known to all,the ASCII of character 'a' is 97. Now,find out how many character 'a' in a group of given numbers. Please note that the numbers here are given by 32 bits’ integ原创 2017-06-09 23:06:16 · 289 阅读 · 0 评论 -
hdu5583_Kingdom of Black and White_思维
Problem DescriptionIn the Kingdom of Black and White (KBW), there are two kinds of frogs: black frog and white frog.Now N frogs are standing in a line, some of them are black, the others are w原创 2017-06-23 20:52:13 · 336 阅读 · 0 评论 -
hdu5578_Friendship of Frog_思维
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5578题目大意:让你找出两个相同字母间的最小距离。解题思路:对字母组进行标记,出现过的字母标记下,并记下位置,再次出现的时候计算一下与上一次距离,然后更新最小距离就行代码:#include #include #include #include #include原创 2017-06-24 09:07:55 · 258 阅读 · 0 评论 -
hdu5135 Little Zu Chongzhi's Triangles(思维)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5135题意:给你n个长度的线段,让你组成三角形,最后输出所有能组成的三角形的面积和的最大值,每条线段只能使用一次。解:首先我们得知道什么情况下,我们所构造的三角形面积最大。现在我们拥有长短不一的线段。那么,问题转化成是长度差不多的线段组成三角形面积较大,还是最长的线段组成原创 2017-07-31 23:16:11 · 250 阅读 · 0 评论 -
hdu6043_思维
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6043题意主角有n双袜子,他需要在所有袜子穿完的前一天将之前的袜子洗了再穿,问你在第k天他穿的是第几双袜子解:思维题,在草稿上推推就知道是一个循环节的题,之后找个循环节就行了,需要特判一下只有两双袜子的情况。代码:#include #include #include原创 2017-07-27 11:38:44 · 357 阅读 · 0 评论 -
hdu6055_Regular polygon_暴力枚举
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6055题意: 给你n个点的坐标,坐标以整型输入,问所有的点能组成多少个正多边形。解:坐标都是整数输入,那么整数坐标能组成的正多边形只有正方形。但正方形的位置是随意的。让后我们会发现正方形可以分解为四个直角三角形。如图:然后,我们就能得到四个点的原创 2017-07-28 09:02:11 · 1142 阅读 · 2 评论 -
hdu6047 Maximum Sequence
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6047题意:给你n个a,a[1]~a[n],和n个b,b[1]~b[n],现在让你补全接下来n个a(从a[n+1]~a[2n),规则是:选一个b[i],在a[b[i]]~a[n]这段区间中能够取得一个a[j]-j(满足a[j]-j 在这段区间中值最大),补全到a[n+1]~a[2n]里。原创 2017-07-29 10:28:06 · 368 阅读 · 0 评论 -
hdu4998 Rotate(计算几何+模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4998题目大意:n次旋转,每一次以(x,y)为中心点旋转弧度p。问最终旋转的效果相当于是围绕哪个点旋转弧度P?输出这个点坐标以及旋转的弧度P解:这题就是模拟做的,因为数据量不大。模拟做就是写起来麻烦。因为用的旋转模板是逆时针旋转,但最后求的P是在三角形里求解出来的,这样的P一定小原创 2017-09-06 22:38:59 · 274 阅读 · 0 评论 -
hdu6052 To my boyfriend (枚举计数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6052题意:给出一个矩阵,需要你求解所有子矩阵的不同数*该子矩阵的个数的和/所有子矩阵的个数。解:1(求子矩阵的个数)如果以(i,j)为矩阵右下角的点,那么构成该矩阵还需要两条边的限制,则在i之前的边中选择一条为C(i)(1),在j之前中选择一条为C(j)(1),结果为=i*j个子矩阵。原创 2017-08-29 18:57:38 · 381 阅读 · 0 评论 -
UVA - 1589 Xiangqi (模拟)
题目链接:题目大意:下象棋,黑方只有“将”棋;红方有“車”,“马”,“炮”,“帅”四种棋;现在规则是:1.马不能撇脚;2.两“将”不能相对;3.炮需要隔一个子才能打另一个子;4.車打人中间不能隔子问红方能不能把黑方“将死”,能输出“YES”,不能输出“NO”;解:一个比较麻烦的模拟,注意细节!注意细节!注意细节才能过!代码:#include原创 2017-10-04 16:10:44 · 307 阅读 · 0 评论 -
CodeForces808a_水(求整数长度)
A. Lucky Yeartime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputApart from having lots of holidays throughout原创 2017-05-21 17:49:10 · 344 阅读 · 0 评论 -
CodeForces807c_二分+思维
C. Success Ratetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are an experienced Codeforces user. Tod原创 2017-05-21 17:33:05 · 326 阅读 · 0 评论 -
cdoj_758_P酱的冒险旅途
P酱是个可爱的男孩子,有一天他在野外冒险,不知不觉中走入了一块神奇的地方。他在0 0时刻进入这个地方,每一时刻他都只能向某一特定的方向移动长度为1的距离,当然他也可以选择不移动。移动需要花费1 1的时间。各个时刻他允许移动的方向由一个字符串给出,字符串只包含U、D、L、R四种字符,其中U表示向上(y y轴正方向)移动,D表示向下(y y轴负方向)移动,L表示向左(x x轴负方向)移动,R表示向原创 2017-05-24 18:57:37 · 389 阅读 · 0 评论 -
hdu1029_大水题(思维)
解:(额,省赛的热身赛上的水题,1分钟a掉)排序,输出中间的那个数。代码:#include #include #include using namespace std;const int maxn=999999;int a[maxn];int main(){ int t; while(scanf("%d",&t)!=-1) { fo原创 2017-05-15 12:11:55 · 231 阅读 · 0 评论 -
poj3438_Look and Say_暴力水
Look and Say The look and say sequence is defined as follows. Start with any string of digits as the first element in the sequence. Each subsequent element is defined from the previous one by "v原创 2017-05-15 17:37:28 · 238 阅读 · 0 评论 -
CDOJ24_8球胜负
8球胜负(eight) EditTime Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus 8 8球是一种台球竞赛的规则。台面上有7 7个红球、7 7个黄球以及一个黑球,当然还有一个白球。对于本题,我们使用如下的简化规则:红原创 2017-05-15 21:56:30 · 158 阅读 · 0 评论 -
HDU Automatic Judge
Automatic JudgeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionWelcome to HDU to原创 2017-05-07 18:05:37 · 298 阅读 · 0 评论 -
CDOJ_1605_京电的刘老师(水)
京电的刘老师 EditTime Limit: 3000/1000MS (Java/Others) Memory Limit: 1000/1000KB (Java/Others)SubmitStatus N Input第一行一个正整数N(n≤10 6 ) N(n≤106),第二行N−1 N−1个整数表示仍存在的药丸Output原创 2017-05-16 16:23:05 · 289 阅读 · 0 评论 -
Gym_100971_Triangles
There is a set of n segments with the lengths li. Find a segment with an integer length so that it could form a non-degenerate triangle with any two segments from the set, or tell that such segment原创 2017-05-19 10:24:20 · 385 阅读 · 0 评论 -
Gym_100971G_Repair
Alex is repairing his country house. He has a rectangular metal sheet of size a × b. He has to cut two rectangular sheets of sizes a1 × b1 and a2 × b2 from it. All cuts must be parallel to the sides原创 2017-05-19 10:38:18 · 422 阅读 · 0 评论 -
hdu4572_Bottles Arrangement_(思维+找规律)
Problem Description Hunan cuisine is really wonderful! But if you don’t like spicy food, you will feel terrible since it can be hard for you to find any food without hot pepper here. Big Fan is a s原创 2017-05-30 09:07:52 · 452 阅读 · 0 评论 -
hdu6231 K-th Number(二分答案+尺取)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6231题意:输入n,k,m,需要求在n个数的a数组中,任意区间里选择第k大的数存入b数组,在b数组中求得第m大的数解:其实一开始没懂怎么去解这道题,但可以反过来想想,如果我是b数组中一个数如何满足题目所要求的条件 ?首先将a数组存入b数组,且将b数组排序,二分下标得到b[mi原创 2017-11-16 19:57:57 · 475 阅读 · 0 评论