![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm水题
文章平均质量分 77
打酱油的张起灵
一瓶酱油打天下
展开
-
HDU 1796 How many integers can you find (数论之容斥)
How many integers can you findTime Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4950 Accepted Submission(s): 1416Problem Description原创 2015-04-15 20:00:05 · 461 阅读 · 0 评论 -
zoj-K - Known Notation
Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows al原创 2015-10-03 14:48:25 · 352 阅读 · 0 评论 -
Regionals 2014 >> South Pacific
题意:给出n只袜子和一个k,每只袜子的长度不同。求两只袜子相差值从小到大第k位的袜子是哪两只。思路:虽然题目给了20s,粗算之下暴力不会超时,然而数组是很多组的,所以纯暴力会超时。于是就想到了二分袜子的差值,本题对于数据的处理很苛刻,是一道卡时的好题。#include#include#include#include#include#include#include#in原创 2015-09-06 15:59:36 · 366 阅读 · 0 评论 -
Regionals 2014 >> Asia - Tokyo
题意:走过N个点到达出口,有M个约束条件,每个约束条件ci、di,di必须在ci前走,也就是说如果先走了ci那么就需要走到di后再折回来再走一遍ci(并且di是大于ci的,所以一定是要走回来的)思路:基础步数肯定是N+1.然后我们将需要走回的最左边排序,记录当前最左边和最右边;如果当前最右边小于当前状态的左边,那么就可以把前面那些进行计算了,即步数加上当前最右边走到当前最左边的步数和再走回来的原创 2015-09-05 15:56:42 · 411 阅读 · 0 评论 -
Regionals 2014 >> Asia - Tokyo
题意:给你一串01,只有相邻两位可以互换。一串把上面那个串划分为m块每块有pi的数字,求满足条件的最小步数。思路:显然,如果第一块是0、那么第二块是1、第三块是0......即两块是不同的,所以每隔一块就是相同数字的块。那么我们就可以假定第一块是0的时候,把那些应该是1的块里的0全部移到0块里的1的最小步数之和,就是当前总最小步数;还要假定第一块是1的时候。取最小值即可。#incl原创 2015-09-05 13:09:04 · 565 阅读 · 0 评论 -
Regionals 2014 >> Latin America
Substrings are strings formed by choosing a subset of contiguous characters from a string. This is wellknown. A little more obscure is the definition of substhreengs. A substhreeng is a substring wh原创 2015-09-03 11:43:08 · 446 阅读 · 0 评论 -
Regionals 2014 >> Latin America 6822 - Black a
6822Black and white stonesShagga and Dolf like to play a game with stones, each of which is either black or white. At the beginningof the game, Dolf arranges all the stones in a single line from原创 2015-09-03 09:11:04 · 537 阅读 · 0 评论 -
6886 - Golf Bot
6886 Golf BotDo you like golf? I hate it. I hate golf so much that Idecided to build the ultimate golf robot, a robot thatwill never miss a shot. I simply place it over the ball,choose the rig原创 2015-08-30 13:31:04 · 964 阅读 · 0 评论 -
CF268C. Beautiful Sets of Points
C. Beautiful Sets of Pointstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao has invented a new mathema原创 2015-08-22 16:10:28 · 511 阅读 · 0 评论 -
CF251A. Points on Line
A. Points on Linetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya likes points a lot. Recently原创 2015-08-21 13:16:58 · 814 阅读 · 0 评论 -
百度之星2015初赛(1)1003 HDOJ5248 序列变换(二分 贪心)
序列变换Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 631 Accepted Submission(s): 309Problem Description给定序列A={A1,A2,...,An},原创 2015-06-11 22:33:22 · 641 阅读 · 0 评论 -
百度之星2015初赛(1)1002 HDOJ5247 找连续数(暴力 简单做法)
找连续数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 819 Accepted Submission(s): 300Problem Description小度熊拿到了一个无序的数组,对于这个数组,小度熊想知道原创 2015-06-09 21:49:51 · 1069 阅读 · 0 评论 -
CF527A Playing with Paper
A. Playing with Papertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Vasya was sitting on a not so原创 2015-05-12 09:16:36 · 1010 阅读 · 0 评论 -
ZOJ3822-Domination 概率DP
DominationTime Limit: 8 Seconds Memory Limit: 131072 KB Special JudgeEdward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with hi原创 2015-10-03 22:44:01 · 425 阅读 · 0 评论