思维
傻子不会玩
菜鸡的博客
展开
-
Codeforces Round #672 (Div. 2) B. Rock and Lever
Danik urgently needs rock and lever! Obviously, the easiest way to get these things is to ask Hermit Lizard for them.Hermit Lizard agreed to give Danik the lever. But to get a stone, Danik needs to solve the following task.You are given a positive intege原创 2020-11-26 22:20:51 · 168 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2) A
Wheatley decided to try to make a test chamber. He made a nice test chamber, but there was only one detail absent — cubes.For completing the chamber Wheatley needs n cubes. i-th cube has a volume ai.Wheatley has to place cubes in such a way that they wou原创 2020-11-26 22:02:38 · 176 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) D2. Sage‘s Birthday (hard version)
outputstandard outputThis is the hard version of the problem. The difference between the versions is that in the easy version all prices ai are different. You can make hacks if and only if you solved both versions of the problem.Today is Sage’s birthday,原创 2020-11-25 23:28:13 · 145 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) C. Killjoy
outputstandard outputA new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).Killjoy’s account is already infected and has原创 2020-11-25 23:22:27 · 117 阅读 · 0 评论 -
NBUT 1566 格式化 数组模拟区间覆盖问题
伟大的程序员——TT的电脑里有N份数据,分别编号从1到N。同事QAQ嫉妒他的能力,趁TT不在的时候把TT电脑里的数据给格式化了!(卧槽没想到QAQ居然是这样的人,怎么能格式化T^T的电脑呢!应该把它拿走呀,里面肯定有很多珍贵的资源呀~~比如说吊炸天的新OJ源代码呀~)Input有多组测试数据,每组输入第一个为一个正整数N(4 <= N <= 50,000)。 接下来一行包含一个正整...原创 2019-11-12 11:31:31 · 141 阅读 · 0 评论 -
子串查询 二分
链接:https://ac.nowcoder.com/acm/contest/1083/B来源:牛客网给出一个长度为n的字符串s和q个查询。对于每一个查询,会输入一个字符串t,你需要判断这个字符串t是不是s的子串。子串的定义就是存在任意下标a<b<c<d<e,那么”s[a]s[b]s[c]s[d]s[e]”就构成s的一个子串。如”abc”的子串有”a”、”b”、”c”、...原创 2019-09-08 23:47:48 · 179 阅读 · 0 评论 -
codeforce 570C 字符串
ReplacementTimeLimit:2000MS MemoryLimit:256MB64-bit integer IO format:%I64dProblem DescriptionDaniel has a string s, consisting of lowercase English letters and period signs (characters ‘.’). Let...原创 2019-08-22 00:12:05 · 190 阅读 · 0 评论 -
洛谷 P1007
题目背景战争已经进入到紧要时间。你是运输小队长,正在率领运输部队向前线运送物资。运输任务像做题一样的无聊。你希望找些刺激,于是命令你的士兵们到前方的一座独木桥上欣赏风景,而你留在桥下欣赏士兵们。士兵们十分愤怒,因为这座独木桥十分狭窄,只能容纳11个人通过。假如有22个人相向而行在桥上相遇,那么他们22个人将无妨绕过对方,只能有11个人回头下桥,让另一个人先通过。但是,可以有多个人同时呆在同一个位...原创 2019-08-13 00:41:01 · 207 阅读 · 0 评论 -
codeforce 579 A,B
There are n students standing in a circle in some order. The index of the i-th student is p_i. It is guaranteed that all indices of students are distinct integers from 1 to n (i.?e. they form a permut...原创 2019-08-16 00:53:10 · 138 阅读 · 0 评论 -
洛谷 P2320 分治
鬼谷子非常聪明,正因为这样,他非常繁忙,经常有各诸侯车的特派员前来向他咨询时政。有一天,他在咸阳游历的时候,朋友告诉他在咸阳最大的拍卖行(聚宝商行)将要举行一场拍卖会,其中有一件宝物引起了他极大的兴趣,那就是无字天书。但是,他的行程安排得很满,他已经买好了去邯郸的长途马车票,不巧的是出发时间是在拍卖会快要结束的时候。于是,他决定事先做好准备,将自己的金币数好并用一个个的小钱袋装好,以便在他现有...原创 2019-08-15 00:26:49 · 159 阅读 · 0 评论 -
FJUT 3876 优先队列 反悔贪心
moxin最近太穷了,穷到只能去卖菜了,moxin进了一批菜,每个菜有过期时间ti与对应的价格wi,由于moxin实在是不会卖菜,富婆弟弟可怜moxin,于是决定每天向moxin买一种菜,moxin这么有节操的人是不会卖过期的菜的,假设时间是无穷的,那么请问moxin最多能卖出多少价值的菜?(时间从1开始)Input输入一个n,代表有n种菜(1 <= n <= 105)有多组输入数...原创 2019-08-05 18:33:48 · 182 阅读 · 0 评论 -
Codeforce 1187B && FJUT3797 二维数组标记法
Problem Description众所皆知,神奇海螺会向外吐出对应的字符,这天,dsc捡到了一个神奇海螺,于是dsc想从神奇海螺里得到他想要的字符举个例子,brrbyhebd是神奇海螺能够吐出的字符,dsc想要的是bryb,那么dsc就得让神奇海螺吐出5个字符如果是hbrry那么就得让神奇海螺吐出6个字符如果是r的话就得吐出2个字符Input第一行给出一个n,代表神奇海螺吐出的字符...原创 2019-07-19 00:56:00 · 215 阅读 · 0 评论 -
HDU 2037 FJUT 3814 求独立区间个数最多
Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%…”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小...原创 2019-07-19 13:14:42 · 153 阅读 · 0 评论 -
Codeforce 977B 二维数组标记
Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, “AZ”, “AA”, “ZA” — three distinct two-grams.You are given a string s consisting of n capital Latin lette...原创 2019-07-21 00:40:29 · 356 阅读 · 0 评论 -
Codeforce 1104B 字符串思维题 类回文(栈)
Game with stringTimeLimit:1000MS MemoryLimit:256MB64-bit integer IO format:%I64d已解决 | 点击收藏Problem DescriptionTwo people are playing a game with a string s, consisting of lowercase latin letters....原创 2019-07-31 00:39:51 · 206 阅读 · 0 评论