
个人赛和组队赛补题
Stephencurry‘s csdn
这个作者很懒,什么都没留下…
展开
-
H - H (CodeForces-612D)(排序+区间计数)
You are givennsegments on the coordinate axisOxand the numberk. The point issatisfiedif it belongs to at leastksegments. Find the smallest (by the number of segments) set of segments on the c...原创 2020-04-25 11:55:04 · 195 阅读 · 0 评论 -
G - G (51Nod-1632)(期望)
B国拥有n个城市,其交通系统呈树状结构,即任意两个城市存在且仅存在一条交通线将其连接。A国是B国的敌国企图秘密发射导弹打击B国的交通线,现假设每条交通线都有50%的概率被炸毁,B国希望知道在被炸毁之后,剩下联通块的个数的期望是多少?Input一个数n(2<=n<=100000) 接下来n-1行,每行两个数x,y表示一条交通线。(1<=x,y<=n) 数据保证其交通系...原创 2020-04-25 10:49:47 · 220 阅读 · 0 评论 -
E - E.龙皇异次元 (POJ-3723)(最大生成树)
Windy has a country, and he wants to build an army to protect his country. He has picked upNgirls andMboys and wants to collect them to be his soldiers. To collect a soldier without any privilege,...原创 2020-04-23 17:32:42 · 355 阅读 · 0 评论 -
C - C.惊天浪涛杀 (CodeForces-1140C)(堆栈+贪心)
You have a playlist consisting ofnnsongs. Theii-th song is characterized by two numberstitiandbibi— its length and beauty respectively. The pleasure of listening to set of songs is equal to the...原创 2020-04-23 16:47:04 · 263 阅读 · 0 评论 -
C-Super Star (POJ-2069)(最小球覆盖+模拟退火)
During a voyage of the starship Hakodate-maru (see Problem 1406), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super st...原创 2020-04-18 11:37:19 · 418 阅读 · 0 评论 -
D-Jamie and Interesting Graph (CodeForces-916C)(构造)
Jamie has recently found undirected weighted graphs with the following properties veryinteresting:The graph is connected and contains exactlynvertices andmedges. All edge weights are integers ...原创 2020-04-16 11:33:35 · 285 阅读 · 2 评论 -
Maximum GCD UVA - 11827(输入坑)
Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.InputThe first line of input is an integer N (1 < N < 100) that dete...原创 2020-04-13 17:15:00 · 170 阅读 · 0 评论 -
H - Is It A Tree? (POJ-1308)(HDU-1325)(并查集)
A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.There i...原创 2020-04-11 17:33:35 · 157 阅读 · 0 评论 -
D - Maya Calendar (POJ-1008)(模拟)
玛雅使用两种日历,第一种称为Haab,一年为365天,一年分为19个月,前18个月每个月都是20天,第19个月为5天,每一个月都有一个名字,分别为pop, no, zip, zotz, tzec, xul, yoxkin, mol, chen, yax, zac, ceh, mac, kankin, muan, pax, koyab, cumhu和uayet,每个月份中的天数用0到19表示。最后一...原创 2020-04-11 11:24:02 · 197 阅读 · 0 评论 -
B - Checkout Assistant (CodeForces-19B)(01背包)
Bob 来到一个现金便利店,放置了n件商品到他的手推车,然后前往收银台付款。每件商品用两个属性描述:价格ci,时间ti(收银员花在这件商品上的时间,以秒计)。当收银员被某件商品占用时间之时,Bob 可以从手推车窃取一些其他商品。Bob 恰好需要 1 秒钟,才能窃取一件商品。请问,Bob 必须最少支付多少钱给收银员?注意:商品递给收银员的顺序,由 Bob 决定。输入第一行包含了数...原创 2020-04-11 10:49:56 · 358 阅读 · 0 评论 -
A - 你能数的清吗 (51Nod-1770)(思路+找规律)
演演是个厉害的数学家,他最近又迷上了数字谜。。。。他很好奇 xxx...xxx(n个x)*y的答案中 有多少个z,x,y,z均为位数只有一位的整数。大概解释一下:22222*3 = 66666,里面有5个6。Input多组测试数据。 第一行有一个整数T,表示测试数据的数目。(1≤T≤5000) 接下来有T行,每一行表示一组测试数据,有4个整数x,y,z,n。 (1≤x,y≤...原创 2020-04-06 15:32:35 · 121 阅读 · 0 评论 -
I - 动物狂想曲 (HDU-6252)(差分约束-最短路模型+判负环)
雷格西桑和路易桑是好朋友,在同一家公司工作。他们总是一起乘地铁去上班。他们的路线上有N个地铁站,编号从1到N。1站是他们的家,N站是公司。有一天,雷格西桑起床晚了。当他来到车站时,路易桑已经离开X分钟了。雷格西桑非常着急,于是他开始和路易桑聊天,交流他们的位置。内容是雷格西桑在A站和B站之间,路易桑在C站和D站之间。B等于A+ 1这意味着雷格西在A站和A+1之间, 或B等于A这意味着雷格西就是...原创 2020-04-06 11:48:52 · 268 阅读 · 0 评论 -
Gym - 101194D (二分)
熊猫先生非常喜欢冰淇淋,尤其是冰淇淋塔。一个冰淇淋塔由K个冰淇淋球堆叠成一个塔。为了使塔稳定,下面的冰淇淋球至少要有它上面的两倍大。换句话说,如果冰淇淋球从上到下的尺寸是A0, A1, A2,···,AK 1,那么A0×2 ≤ A1, A1 × 2 ≤ A2,等等。有一天,熊猫先生在街上走着,发现一家卖冰淇淋球的商店。冰淇淋球共有N个,大小分别为B0、B1、B2、··、BN−1。潘达先生想知道这...原创 2020-04-03 22:38:00 · 235 阅读 · 0 评论 -
异或最大值
异或最大值在C语言中,异或运算符是^。不管运算对象是10进制的数还是16进制的数(或其他进制的数),进行^运算时,都是将运算对象转换为二进制,按位进行异或运算。举例说明如下:int a=0x9a, b=0x56;int c = a^b; // 将a和b进行异或运算运算过程是a = 1001 1010 // 0x9ab = 0101 0110 // 0x56c = 1100 11...原创 2019-03-04 21:29:28 · 3132 阅读 · 0 评论 -
分组的困扰
分组的困扰题目:传送门题目描述:有n个人想要下棋(1 对 1),但是大家都想和与自己水平差不多的人下棋,已知每个人都有一个实力值,如果俩人实力相差 >= k,那么他们就不会浪费时间去切磋棋艺。求最多需要多少棋盘,两个人互相切磋只需要一个棋盘。输入描述:第一行一个整数t,表示t组输入,t <= 100接下来t组数据,每组数据第一行有两个整数用空格分隔表示n,...原创 2019-03-04 21:33:27 · 189 阅读 · 0 评论 -
G - 很麻煩的題 (hdu1250)
G - 很麻煩的題 (hdu1250)A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(...原创 2019-03-29 19:57:57 · 275 阅读 · 0 评论 -
P - 无剑无我 (HDU 2547)
P - 无剑无我 (HDU 2547)北宋末年,奸臣当道,宦官掌权,外侮日亟,辽军再犯。时下战火连连,烽烟四起,哀鸿遍野,民不聊生,又有众多能人异士群起而反,天下志士云集响应,景粮影从。值此危急存亡之秋,在一个与世隔绝的地方---MCA山上一位江湖人称<英雄哪里出来>的人正在为抗击辽贼研究剑法,终于于一雷电交加之夜精确计算出了荡剑回锋的剑气伤害公式。定义 f(x, y, m...原创 2019-03-29 20:18:43 · 378 阅读 · 0 评论 -
J - Bored Three-God (NBUT 1228)
J - Bored Three-God (NBUT 1228)The bored Three-God get another boring question.This problem is ask you plus two big nubmer, please help him, when you solve this problem you canspeak to Three-God...原创 2019-03-29 22:36:51 · 322 阅读 · 0 评论 -
Coat of Anticubism (CodeForces - 667B )
Coat of Anticubism (CodeForces - 667B )As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geomet...原创 2019-04-18 21:32:45 · 340 阅读 · 0 评论 -
Buses Between Cities (CodeForces - 665A )
Buses Between Cities (CodeForces - 665A )Buses run between the citiesAandB, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the cityAdeparts everya...原创 2019-04-18 21:19:08 · 516 阅读 · 0 评论 -
Secrete Master Plan(HDU - 5540)
Secrete Master Plan(HDU - 5540)Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a pocket. The plan instructs how to deploy soldiers on the four corners of the city wall. Unfortun...原创 2019-04-18 08:34:01 · 400 阅读 · 0 评论 -
Huatuo's Medicine (HDU - 5551 )
Huatuo's Medicine (HDU - 5551 )Huatuo was a famous doctor. He use identical bottles to carry the medicine. There are different types of medicine. Huatuo put medicines into the bottles and chain thes...原创 2019-04-16 19:37:03 · 304 阅读 · 0 评论 -
A - 水题A (CodeForces - 106B )
A - 水题A (CodeForces - 106B )Vasya is choosing a laptop. The shop hasnlaptops to all tastes.Vasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer an...原创 2019-04-09 09:42:06 · 373 阅读 · 0 评论 -
E - 死锁 (FZU - 1924 )
E - 死锁 (FZU - 1924 )在操作系统中存在着死锁问题。进程在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去。此时称系统处于死锁状态或系统产生了死锁,这些永远在互相等待的进程称为死锁进程。由于资源占用是互斥的,当某个进程提出申请资源后,使得有关进程在无外力协助下,永远分配不到必需的资源而无法继续运行,这就产生了死锁。例如,如果线程A...原创 2019-04-04 15:47:17 · 291 阅读 · 0 评论 -
C - Unusual Product (CodeForces 405C)
C - Unusual Product (CodeForces 405C)Little Chris is a huge fan of linear algebra. This time he has been given a homework about theunusual squareof a square matrix.Thedot productof two integer...原创 2019-04-03 21:19:40 · 382 阅读 · 0 评论 -
G - Domino Effect (CodeForces 405B)
G - Domino Effect (CodeForces 405B)Little Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to play with the dominoes and make ...原创 2019-04-03 20:38:59 · 326 阅读 · 0 评论 -
G - 水题G (CodeForces 1051C)
G - 水题G (CodeForces 1051C)万圣节到了,杰哥准备给班级里的同学发糖吃,男生女生各一堆。于是他去腐败街的xx小卖部买糖,他认为糖只要是独一无二的那他就是好糖,他跟老板说他想要买n个不一样的糖,但是老板是个黑心商贩,当杰哥把糖带回去的时候才发现有挺多相同的糖而杰哥是一个公平正直的人,他希望男生女生两堆糖中好糖的数量相同,于是他想找你帮忙来解决他的烦恼。为了简化问题我们将...原创 2019-04-02 09:37:07 · 271 阅读 · 0 评论 -
H - A Simple Triangle (NBUT 1226)
H - A Simple Triangle (NBUT 1226)In this problem you need to make a triangle ,just like the sample out. The element in the ith row and jth columnshould be the product(乘积) of i and j.InputThe f...原创 2019-04-02 08:58:17 · 272 阅读 · 0 评论 -
C - Time (NBUT 1219)
C - Time (NBUT 1219)Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed ...原创 2019-04-02 08:24:41 · 427 阅读 · 0 评论 -
B - You are my brother (NBUT 1218)
B - You are my brother (NBUT 1218)Little A gets to know a new friend, Little B, recently. One day, they realize that they are family 500 years ago. Now, Little A wants to know whether Little B is hi...原创 2019-04-01 20:53:32 · 418 阅读 · 0 评论 -
A - Dinner (NBUT 1217)
A - Dinner (NBUT 1217)Little A is one member of ACM team. He had just won the gold in World Final. To celebrate, he decided to invite all to have one meal. As bowl, knife and other tableware is not ...原创 2019-04-01 20:17:48 · 387 阅读 · 0 评论 -
I - Binary to Decimal (NBUT 1227)(二进制转化十进制)
I - Binary to Decimal (NBUT 1227)The boring Three-God get a boring question.So you have to transform a binary number to a decimal.InputThere are muti-case.For each case, there are a binary nu...原创 2019-04-01 19:40:26 · 561 阅读 · 0 评论 -
Pouring Rain (CodeForces - 667A )
Pouring Rain (CodeForces - 667A )A lot of people in Berland hates rain, but you do not. Rain pacifies, puts your thoughts in order. By these years you have developed a good tradition — when it rains...原创 2019-04-18 21:48:22 · 392 阅读 · 0 评论