
好题
文章平均质量分 82
RJ28
小学生
展开
-
Technocup 2021 - Elimination Round 2 D. XOR-gun
Arkady owns a non-decreasing array ????1,????2,…,????????. You are jealous of its beauty and want to destroy this property. You have a so-called XOR-gun that you can use one or more times.In one step you can select two consecutive elements of the array, l原创 2020-12-09 13:53:16 · 314 阅读 · 0 评论 -
Codeforces Round #614 (Div. 1) D. Chaotic V.
"Everything has been planned out. No more hidden concerns. The condition of Cytus is also perfect.The time right now… 00:01:12…It’s time."The emotion samples are now sufficient. After almost 3 year...原创 2020-01-28 19:34:45 · 360 阅读 · 0 评论 -
POJ-1845 Sumdiv
DescriptionConsider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901).InputThe only line contains the原创 2016-04-26 21:57:42 · 703 阅读 · 0 评论 -
Uva 11134 Fabled Rooks
链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2075题目大意:在一个n*n的棋盘上放置n个车,使得它们之间都不能互相攻击(任意两个车都不能同行或同列),并且,对于第i个车,限制它只能放在一个矩形区域内,(xl原创 2016-04-28 00:33:46 · 373 阅读 · 0 评论 -
Codeforces 526C - Om Nom and Candies
A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with原创 2016-05-10 19:37:14 · 1241 阅读 · 0 评论 -
Codeforces Round #283 (Div. 2) D. Tennis Game
Petya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of multiple sets, each set consists of multiple serves. Each serve is won by one o原创 2016-05-10 23:59:10 · 839 阅读 · 0 评论 -
Codeforces 658D Bear and Polynomials
Limak is a little polar bear. He doesn't have many toys and thus he often plays with polynomials.He considers a polynomial valid if its degree is n and its coefficients are integers not exceedin原创 2016-04-16 22:00:37 · 577 阅读 · 0 评论 -
Gym 100917 A. Abstract Picture
Famous abstract painter Va Sya plans to start new painting. It will be composed as square with gridn × n, where each unit square is painted by some color.Va Sya already defined the colors for some unit squares. Color of other squares does not matter for h原创 2016-03-27 15:24:47 · 709 阅读 · 0 评论 -
LA 3266 Tian Ji -- The Horse Racing (贪心 || DP)
Problem DescriptionHere is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king原创 2016-04-30 23:18:06 · 496 阅读 · 0 评论 -
Codeforces Round #347 (Div. 2) B. Rebus
You are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer n. The goal is to replace each questi原创 2016-05-14 00:03:00 · 530 阅读 · 0 评论 -
LA 4636 Cubist Artwork(贪心)
International Center for Picassonian Cubism is a Spanish national museum of cubist artworks, dedicated to Pablo Picasso. The center held a competition for an artwork that will be displayed in front of原创 2016-05-03 17:58:19 · 1640 阅读 · 0 评论 -
Codeforces Round #347 (Div. 1) B. International Olympiad
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of formIAO'y, where y stands for some number of consequent last digits原创 2016-05-14 17:16:16 · 335 阅读 · 0 评论 -
Fzu-2190 非提的救赎 (单调栈)
Problem Description正如你所知道从前有一个人叫s_sin,她拥有着坐拥三千舰狼的梦想!然而天不遂人愿当她踏进hentai collection的大门之后,现实让她领略到了无情。身为一个坚强的妹子,她知道即使出门大破,即使十一连抽全是R,也要坚信着“玄不救非,氪不改命”,而自己是一个欧白这样最初的信仰!有一天s_sin率领着她的舰狼们到达了某海峡,以一个N*M的原创 2016-05-04 17:12:35 · 679 阅读 · 0 评论 -
CodeForces 629C Famil Door and Brackets
As Famil Door’s birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of原创 2016-05-15 18:05:46 · 428 阅读 · 0 评论 -
Hdu-5301 Buildings(思维题)
Problem DescriptionYour current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments in t原创 2016-05-29 10:44:49 · 466 阅读 · 0 评论 -
Hdu-5289 Assignment (二分+RMQ || 单调队列)
Problem DescriptionTom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is going to assign a special task原创 2016-05-29 10:51:49 · 388 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) C. Money Transfers
There are n banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no more than1. Also, bank 1 and bankn are neighbo原创 2016-05-17 16:22:14 · 615 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) D. Tree Construction
During the programming classes Vasya was assigned a difficult problem. However, he doesn't know how to code and was unable to find the solution in the Internet, so he asks you to help.You are given原创 2016-05-17 17:16:30 · 722 阅读 · 0 评论 -
BZOJ-3670: [Noi2014]动物园
Description近日,园长发现动物园中好吃懒做的动物越来越多了。例如企鹅,只会卖萌向游客要吃的。为了整治动物园的不良风气,让动物们凭自己的真才实学向游客要吃的,园长决定开设算法班,让动物们学习算法。某天,园长给动物们讲解KMP算法。园长:“对于一个字符串S,它的长度为L。我们可以在O(L)的时间内,求出一个名为next的数组。有谁预习了next数组的含义吗?”熊猫:“对于原创 2016-05-18 16:17:59 · 373 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) E. Trains and Statistic
Vasya commutes by train every day. There are n train stations in the city, and at thei-th station it's possible to buy only tickets to stations fromi + 1 to ai inclusive. No tickets are sold at th原创 2016-05-31 16:02:11 · 489 阅读 · 0 评论 -
Codeforces Round #258 (Div. 2) D. Count Good Substrings
We call a string good, if after merging all the consecutive equal characters, the resulting string is palindrome. For example, "aabba" is good, because after the merging step it will become "aba".原创 2016-05-08 21:46:12 · 328 阅读 · 0 评论 -
LA 4394 String painter
There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can change a segment of chara原创 2016-06-01 14:59:48 · 813 阅读 · 0 评论 -
Codeforces Round #189 (Div. 1) B. Psychos in a Line
There are n psychos standing in a line. Eachpsycho(心理分析) isassigned(分配) aunique(独特的)integer(整数) from1 to n. At each step every psycho who has an id greater than the psycho to his right (if e原创 2016-05-20 15:38:57 · 730 阅读 · 0 评论 -
Educational Codeforces Round 12 E. Beautiful Subarrays
One day, ZS the Coder wrote down an array of integers a with elementsa1, a2, ..., an.A subarray of the array a is a sequenceal, al + 1, ..., ar for some integers(l, r) such that 1原创 2016-05-21 22:31:39 · 588 阅读 · 0 评论 -
8VC Venture Cup 2016 - Elimination Round C. Block Towers
Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other.n of the students use pieces made of two blocks andm of th原创 2016-05-22 22:28:29 · 474 阅读 · 0 评论 -
Codeforces Round #352 (Div. 1) B. Robin Hood
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person原创 2016-05-12 23:29:35 · 607 阅读 · 0 评论 -
LA 4253 Archery (二分)
Korea's reputation in archery is well known because the Korean archery teams have been sweeping almost all gold, silver, and bronze medals in the Olympic Games.An archery game ICPC supported by NE原创 2016-05-05 08:23:49 · 1279 阅读 · 0 评论 -
UVa 11627 Slalom (二分)
You are competing in a ski slalom, and you need to selectthe best skis for the race. The format of the race is that there areNpairs of left and right gates, where each right gate isW metres to the rig原创 2016-04-26 17:33:21 · 562 阅读 · 0 评论 -
LA 4254 Processor (单调队列 + 二分)
题意:有n个任务,每个任务有三个参数,ri,di,wi,表示在ri di之内需要执行完工作量为wi的任务,任务可以分块执行,求执行过程中的最大速度的最小值。速度需为整数。分析:二分判断,判断有些复杂,要用到单调队列,写的挺烂的,但是一遍过了。#include #include #include #include #include #define MAXN 10002原创 2016-04-25 21:21:35 · 960 阅读 · 0 评论 -
Codeforces Round #356 (Div. 2) D. Bear and Tower of Cubes
D. Bear and Tower of Cubestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little polar bear. He plays by原创 2016-06-09 23:08:19 · 642 阅读 · 0 评论 -
POJ-1276 Cash Machine(经典多重背包)
DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominatio原创 2016-06-10 15:24:27 · 650 阅读 · 0 评论 -
LA 4490 Help Bubu (状压DP)
题意:给出n和k,表示说书架上有n本书,可以取出k次书,每次取出后可以任意放回书架中,书的编号为25~32八种,定义该书架的混乱程度为片段的个数。求出最小的混乱度。原创 2016-06-10 20:07:53 · 1300 阅读 · 0 评论 -
Codeforces Round #355 (Div. 2) D. Vanya and Treasure
Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room located in thei-th row and j-th columns contains the chest of typeaij. Each chest o原创 2016-06-05 21:31:42 · 705 阅读 · 0 评论 -
Hdu-5739 Fantasia (图论点双连通分量+DP)
Problem DescriptionProfessor Zhang has an undirected graph G with n vertices and m edges. Each vertex is attached with a weight wi. Let Gi be the graph after deleting the i-th vertex f原创 2016-07-23 22:58:36 · 636 阅读 · 0 评论 -
LA 4015 Cave,Chengdu 2007.
题意:一棵n个结点的有根树,树的边有正整数权,表示两个结点之间的距离。你的任务是回答这样的询问:从根结点处罚,走不超过x单位距离,最多经过多少个结点?同一个结点经过最多算一次。分析:设dp[x][j][0]表示以x为根的树经过i个点且回来的最小费用,dp[x][j][1]表示不会来的最小费用。 则有: dp[x][j][0] = min(dp[x][j原创 2016-06-02 13:53:16 · 555 阅读 · 0 评论 -
LA 5135 Mining Your Own Business(点双连通分量+贪心)
题意:在一个无向图中选择尽量少的点涂黑,使得任意删除一个点后,每个连通分量至少有一个黑点,问你最少选几个点和其方案数。分析:求出所有点双连通分量后,构造block forest data structure,很容易发现我们只需染”叶子虚点“下的点就可以了,注意当全图为一个连通分量时答案为2,方案为n*(n-1)/2。#include #include #include原创 2016-07-24 17:44:39 · 977 阅读 · 0 评论 -
LA 3523 Knights of the Round Table(点双连通分量+二分图判断)
题意:有n个骑士经常举行圆桌会议,商讨大事,每次圆桌会议至少应有3个骑士参加,且互相憎恨的骑士不能坐在圆桌旁的相邻位置,如果发生意见分歧,则需要举手表决,因此参加会议的骑士数目必须是奇数,以防赞同和反对票一样多,知道哪些骑士互相憎恨之后,你的任务是统计有多少个骑士不可能参加任何一个会议。分析:求出原图的补图后,问题转化为判断一个点是否存在一个奇数环内,一个环内的所有点一定在同一个点双联原创 2016-07-24 15:37:56 · 422 阅读 · 0 评论 -
POJ-3017 Cut the Sequence(DP单调队列优化 + 平衡树)
DescriptionGiven an integer sequence { an } of length N, you are to cut the sequence into several parts every one of which is a consecutive subsequence of the original sequence. Every part must sa原创 2016-07-14 18:00:35 · 702 阅读 · 0 评论 -
BZOJ-1010 [HNOI2008]玩具装箱toy (DP斜率优化)
Description P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京。他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中。P教授有编号为1...N的N件玩具,第i件玩具经过压缩后变成一维长度为Ci.为了方便整理,P教授要求在一个一维容器中的玩具编号是连续的。同时如果一个一维容器中有多个玩具,那么两件玩具之间要加入一个单位原创 2016-07-15 22:31:10 · 639 阅读 · 0 评论 -
POJ-2949 Word Rings(SPFA DFS实现 + 环上平均权值最大)
DescriptionA word ring is a sequence of words where the last two letters of each word are the same as the first two letters of the next word (and the last two letters of the last word are the same a原创 2016-06-20 09:44:53 · 1414 阅读 · 0 评论