自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

BoBoo文睡不醒

一只现役的菜菜,在黑暗中摸索前行

  • 博客(156)
  • 收藏
  • 关注

原创 1003 洞察(2025“钉耙编程”中国大学生算法设计春季联赛(4))

时间回到,初中,午后。早上的数学课,小 hua 刚刚学会一次函数,她已经洞悉其本质。刚刚的上机课,小 hua 刚刚学会异或运算,运用却已经是炉火纯青。于是小 hua 出招,给定正整数 k,b,c,vk,b,c,v,请问有多少非负整数 xx 满足令 px=kx+bp x​ =kx+b 有 px⊕c≤vp x​ ⊕c≤v。小 pang 随手破解,却见小 hua 嘴角仍有一丝笑意:“加上多测,又如何呢?”

2025-03-31 15:19:27 364

原创 1001 战斗爽(2025“钉耙编程”中国大学生算法设计春季联赛(4))

魔法的世界,唯有不断战斗!魔法少女小 hua 拥有强大的群伤法术,面对多个敌人她将毫不退缩。她的攻击会让每个敌人最多承受kk 次攻击,当多次攻击命中同一目标时,从第二次攻击开始将只造成一半伤害。具体的,小 hua 和nn 个敌人战斗,第ii 个敌人的攻击力为

2025-03-31 09:02:32 557

原创 1006 进步(2025“钉耙编程”中国大学生算法设计春季联赛(4))

hua 和你说:我太想进步了。小 hua 记录了 nn 天内每天的分数增减情况(记为 aia i​ ,可能是负数),有时候会发现自己记错了某一天的得分,会将它修正。初始小 hua 得 0 分,从第 1 天开始,累计得分总和每上升 100,就称她进步了一次。(当然因为有可能会扣分而分数下降,甚至总分变成负数)有以下两种操作共 qq 次:修改第 xx 天的小分,变为 yy。询问第 ll 到第 rr 天的进步差,即,第 rr 天后的进步次数减去第 l

2025-03-31 08:53:31 431

原创 1005 持家(2025“钉耙编程”中国大学生算法设计春季联赛(4))

身为魔法少女的小 hua 可能从未考虑过,是否也会有要肩负起家庭与责任的一天。小 hua 在拼夕夕上想购买原价为 PP 元的商品,由于拼夕夕是良心商家,他提前发放了 nn 张优惠券给小 hua。本次购物,小 hua 被允许按照任意顺序使用 kk 张优惠券。优惠券分两种:打折券,打 xx 折,其中 x∈1,2,3,…,9x∈1,2,3,…,9。减免券,直接减 xx 元。商家不会倒贴钱给他,她的花费最少是 0 元。 优惠券均可叠加,例如使用两张 8

2025-03-31 08:43:02 377

原创 Igor and Mountain ( Codeforces Round 1013 (Div. 3) )

The visitors of the IT Campus “NEIMARK” are not only strong programmers but also physically robust individuals! Some practice swimming, some rowing, and some rock climbing!Master Igor is a prominent figure in the local rock climbing community. One day, h

2025-03-27 14:26:53 415 1

原创 1010 选择配送(2025“钉耙编程”中国大学生算法设计春季联赛(3))

在一个二维平面城市中,有 nn 个客户,第 ii (1≤i≤n)(1≤i≤n) 个客户的位置坐标为 (xi,yi)(x i​ ,y i​ )。快递侠需要在 mm 个候选配送站中选择一个作为自己的起始点,第 jj (1≤j≤m)(1≤j≤m) 个配送站的坐标为 (aj,bj)(a j​ ,b j​ )。快递侠在城市中移动时,只能沿水平或垂直方向走,因此两点之间的距离为曼哈顿距离,即对于两点 (p1,

2025-03-25 16:18:58 789

原创 1004 弯曲筷子(2025“钉耙编程”中国大学生算法设计春季联赛(3))

食堂里有 nn 支筷子(nn 为偶数),由于多次使用,每支筷子都有不同程度的弯曲,这让小 x 难以使用。但当两支筷子的弯曲程度相近时,使用起来会更舒适。具体来说,使用两支弯曲度分别为 aa 和 bb 的筷子时,其不舒适度为 (a−b)2(a−b) 2 。小 x 希望从所有筷子中选出若干双,使得不舒适度之和最小。特别地,小 x 对其中 mm 支筷子情有独钟,希望选出的筷子中包含这 mm 支。为了防止输入过大带来的常数问题,C++ 选手请尽量使用关闭流同步的 s

2025-03-25 16:17:58 775

原创 1003 拼尽全力 (2025“钉耙编程”中国大学生算法设计春季联赛(3))

小 x 收到 nn 家公司的面试邀请。因为机会难得,他希望通过每一次面试。每次面试都会从 mm 个不同维度考察小 x 的能力,这些维度分别用 c1,c2,…,cmc 1​ ,c 2​ ,…,c m​ 表示。小 x 在这 m 个维度上的初始能力分别为 a1,a2,…,ama 1​ ,a 2​ ,…,a m​ 。如果小 x 在每个维度上的能力都大于或等于面试的要求,那么他就能通过这次面试。通过面试后,小 x 的每维

2025-03-25 16:16:20 276

原创 Kitchen Robot ( 2010-2011 ACM-ICPC, NEERC, Northern Subregional Contest )

Robots are becoming more and more popular. They are used nowadays not only in manufacturing plants, but also at home. One programmer with his friends decided to create their own home robot. As you may know most programmers like to drink beer when they g

2025-03-24 13:51:46 1142

原创 Alien Communication Masterclass ( 2010-2011 ACM-ICPC, NEERC, Northern Subregional Contest )

Andrea is a famous science fiction writer, who runs masterclasses for her beloved readers. The most popular one is the Alien Communication Masterclass (ACM), where she teaches how to behave if you encounter alien life forms or at least alien artifacts.

2025-03-24 09:56:23 301

原创 Evacuation Plan( 2010-2011 ACM-ICPC Northeastern European Regional Contest (NEERC 10). )

Flatland government is building a new highway that will be used to transport weapons from its main weapon plant to the frontline in order to support the undergoing military operation against its neighbor country Edgeland. Highway is a straight line and t

2025-03-21 20:09:48 662

原创 Dome of Circus ( 2010-2011 ACM-ICPC Northeastern European Regional Contest (NEERC 10). )

A travelling circus faces a tough challenge in designing the dome for its performances. The circus has a number of shows that happen above the stage in the air under the dome. Various rigs, supports, and anchors must be installed over the stage, but und

2025-03-21 20:03:04 752

原创 1006 学博弈论导致的(2025“钉耙编程”中国大学生算法设计春季联赛(2))

桌上有 rr 块红宝石、bb 块蓝宝石和 mm 个宝盒。Alice 和 Bob 要轮流操作,Alice 先手。操作结束后,桌面清空的玩家获胜。操作后若桌面自动出现物品,出现过程也看作操作的一部分。每次操作,两人可以选择下列操作之一:拿走 kk 块红宝石(1≤k≤31≤k≤3)。把一块蓝宝石变成红宝石。拿走 11 块蓝宝石,然后拿走 00 或 11 块红宝石。拿走 22 块蓝宝石,然后桌面上自动出现一块红宝石。拿走一个宝盒说”蓝星“,然后桌面上自动出

2025-03-20 19:01:26 917

原创 1008 学画画导致的(2025“钉耙编程”中国大学生算法设计春季联赛(2))

现有 nn 行的三角形网格(下图展示了 n=2n=2 的情形)和 3n3n 只颜色互不相同的刷子,颜色依次为 1,2,…,3n1,2,…,3n。每只刷子都有固定初始位置和运动方向,其中初始位置和运动方向如下方左图所示。下面 yummy 将以某种顺序让每种刷子作用恰好一次。对于一个格子,其显示的颜色一定是最后一个经过它的刷子的颜色(也就是刷子会完全覆盖原来的颜色)。给出一部分(mm 个,可能重复)格子的最终颜色,判断是否存在符合题意的刷子作用顺序。

2025-03-20 16:23:26 261

原创 1007 分配宝藏(2025“钉耙编程”中国大学生算法设计春季联赛(1))

染染船长终于获得了宝藏!宝藏是很多很多的金币(可以看成无穷多),染染需要与手下的 nn 名水手们分享金币。根据大嘤帝国的传统,分配宝藏对于船长而言是一件稍不留神就会丧命的苦差事。这是由于,船长需要将每人能分到多少宝藏的决议公布,之后全体船员(包括船长)开会投票决定决议是否通过。如果半数及以上船员(包括船长)投票通过,船长就能够安全的执行决议;否则,船长就会被投海杀死,由第 11 顺位继承人继承船长的职位并再次分配,再不通过就继续投海杀死并由第 22 顺位继承人继承,依此类推。好在经过

2025-03-18 18:36:26 685

原创 1009 切割木材(2025“钉耙编程”中国大学生算法设计春季联赛(1))

染染船长,亲自上阵!木材已经被运到船上了,然而直接一根不规则的木材是难以利用的,切割木材就是一道必要的工序了。作为船长,染染要以身作则分割木材。于是染染挑了其中一根长为 nn 米的木材,其每一米上都标有正整数参数,从左往右第 ii 米的参数为 aia i​ ,参数的范围在 [0,2m)[0,2 m ) 内。分割木材都在其整数米处分割,分割后会分成若干段,每个段实际上可以表示为参数序列 a1,a2,⋯,ana 1​ ,a 2​

2025-03-18 18:18:42 981

原创 1005 航线(2025“钉耙编程”中国大学生算法设计春季联赛(1))

染染船长,扬帆起航!在一系列准备工作做完后,染染的船终于出发了。没过多久,染染就来到了一片复杂的海洋。这片海洋可以看成一个 n×mn×m 的网格,网格上的每个格点代表了一片海域。直线通过第 ii 行第 jj 列的海域需要花费 ti,jt i,j​ 的时间。除此之外,如果需要转向,还需要额外花费 di,jd i,j​ 的时间,当然不管向左转向右转还是掉头都需要额外花费 di,jd i,j​ 的时间。也就是说,如果要通过第 ii

2025-03-17 16:17:45 931

原创 1002 船长(2025“钉耙编程”中国大学生算法设计春季联赛(1))

大嘤帝国的东格玛男人,染染,终于成为了一名水手!正如隔壁某位将军的那句“不想做将军的士兵不是好士兵”,不想做船长的水手不是好水手。作为一名好水手,染染自然也报名参与了船长的竞选。报名那天,经过广泛的交流,染染得知,包括他自己在内,总共有 nn 名水手参与竞选。这 nn 名水手都被赋予了一个编号,可以认为第 ii 名参与竞选的水手的编号即为 ii。特别的,染染的编号为 p0p 0​ 。这 nn 名参与竞选的水手当然也不是谁都有竞争力的。根据染染的情报,只有 kk

2025-03-17 16:04:48 740

原创 Jump( 2015-2016 ACM-ICPC Northeastern European Regional Contest (NEERC 15). )

Consideratoy interactiveproblemOneMaxwhichisdefinedas follows. Youknowanintegernand there isahiddenbit stringSof lengthn. Theonlythingyoumaydo is topresent thesystemabit stringQof lengthn,andthesystemwill returnthenumberOneMax(Q)—thenumberofbitswhich c

2025-03-09 21:05:30 786

原创 Detect Shuing Method( Andrew Stankevich Contest 44 )

Detect Shuing Method( Andrew Stankevich Contest 44, XIII Open Cup Onsite Petrozavodsk Summer Training Camp, September 1, 2013 )

2025-03-09 17:23:20 1181

原创 Game with Binary String ( [Educational Codeforces Round 175 (Rated for Div. 2)])

Game with Binary String ( Educational Codeforces Round 175 (Rated for Div. 2) )Consider the following game. Two players have a binary string (a string consisting of characters 0 and/or 1). The players take turns, the first player makes the first turn. Dur

2025-03-04 20:37:27 1020

原创 Friends and Pizza (Educational Codeforces Round 175 (Rated for Div. 2))

Friends and Pizza (Educational Codeforces Round 175 (Rated for Div. 2))Monocarp has nn pizzas, the ii-th pizza consists of aia i​ slices. Pizzas are denoted by uppercase Latin letters from A to the nn-th letter of the Latin alphabet.Monocar

2025-03-04 20:36:14 808

原创 Tree Jumps ( [Educational Codeforces Round 175 (Rated for Div. 2)] )

Tree Jumps ( Educational Codeforces Round 175 (Rated for Div. 2) )You are given a rooted tree, consisting of nn vertices. The vertices in the tree are numbered from 11 to nn, and the root is the vertex 11. Let dxd x​ be the distance (the nu

2025-03-03 12:01:48 854

原创 Limited Repainting ( [Educational Codeforces Round 175 (Rated for Div. 2)])

Limited Repainting ( Educational Codeforces Round 175 (Rated for Div. 2) )You are given a strip, consisting of nn cells, all cells are initially colored red.In one operation, you can choose a segment of consecutive cells and paint them blue. Before pa

2025-03-03 09:36:39 815

原创 P4745 [CERC2017] Gambling Guide

P4745 [CERC2017] Gambling Guide一个铁路系统由 n 个城市和 m 条双向铁路组成。铁路票只能在安装在每个城市的自动售票机购买。不幸的是,黑客们已经篡改了这些售票机,现在它们有下面的规则:当 a 市的售票机有一个硬币投入时,机器会发一张从 a 市到随机一个邻市的单程票。

2025-03-03 09:01:08 717

原创 Discrete Logarithm is a Joke ( 2020-2021 Winter Petrozavodsk Camp)

Discrete Logarithm is a Joke ( 2020-2021 Winter Petrozavodsk Camp, Day 5: Almost Retired Dandelion Contest (XXI Open Cup, Grand Prix of Nizhny Novgorod). )Let’s take M=1018+31M=10 18 +31 which is a prime number, and g=42g=42 which is a primi

2025-02-24 10:36:40 959

原创 Film Critics ( [2020-2021 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2020)])

Film Critics ( 2020-2021 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2020) )The premier of the anticipated action film No Thyme to Fry is right around the corner, and it is time to give early screenings to film critics so that they can review it.

2025-02-24 10:07:43 650

原创 Codeforces Round 1005 (Div. 2)](httpsmirror.codeforces.comcontest2064)

[Codeforces Round 1005 (Div. 2)](https://mirror.codeforces.com/contest/2064)A.Brogramming Contest B.Variety is Discouraged C.Remove the Ends D.Eating

2025-02-21 20:29:52 1094

原创 Beautiful Sequence ( [Educational Codeforces Round 174 (Rated for Div. 2)] )

Beautiful Sequence ( Educational Codeforces Round 174 (Rated for Div. 2) )Let’s call an integer sequence beautiful if the following conditions hold:its length is at least 33;for every element except the first one, there is an element to the left less

2025-02-19 10:43:55 599

原创 Palindrome Shuffle ( [Educational Codeforces Round 174 (Rated for Div. 2)] )

Palindrome Shuffle ( Educational Codeforces Round 174 (Rated for Div. 2) )You are given a string ss consisting of lowercase Latin letters.You can perform the following operation with the string ss: choose a contiguous substring (possibly empty) of

2025-02-19 10:42:59 451

原创 Remove Exactly Two ( [Codeforces Round 1000 (Div. 2)](httpsmirror.codeforces.comcontest2063) )

Remove Exactly Two ( Codeforces Round 1000 (Div. 2) )Recently, Little John got a tree from his aunt to decorate his house. But as it seems, just one tree is not enough to decorate the entire house. Little John has an idea. Maybe he can remove a few vertic

2025-02-17 19:23:41 935

原创 Game With Triangles ( [Codeforces Round 1000 (Div. 2)](httpsmirror.codeforces.comcontest2063) )

Game With Triangles ( Codeforces Round 1000 (Div. 2) )Even Little John needs money to buy a house. But he recently lost his job; how will he earn money now? Of course, by playing a game that gives him money as a reward! Oh well, maybe not those kinds of g

2025-02-17 19:23:02 557

原创 Modulo Permutations ( 2020-2021 ICPC Southeastern European Regional Programming Contest )

Modulo Permutations ( 2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020). )Given a natural number nn, count the number of permutations (p1,p2,…,pn)(p 1​ ,p 2​ ,…,p n​ ) of the numbers from 11 to nn,

2025-02-14 20:52:52 905

原创 Divine Gifting ( [2024-2025 ICPC Southwestern European Regional Contest (SWERC 2024)](gym105677). )

Divine Gifting ( 2024-2025 ICPC Southwestern European Regional Contest (SWERC 2024). )A celestial scroll, detailing Zeus’s latest whim unfurls before Hermes: the next few millenia will be a period of divine gifting for mortals. Hermes, the messenger god,

2025-02-14 20:44:32 990

原创 Reverse Game ( [2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020)])

Reverse Game ( 2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020). )Alice and Bob are playing a turn-based game. The rules of the game are as follows:At the beginning of the game some binary string ss is chosen.On his turn

2025-02-13 20:59:56 1034

原创 Neo-Robin Hood( [2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020)] )

Neo-Robin Hood( 2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020) )There are nn aspiring politicians in Neverland. They are wealthy, but not wealthy enough to gain political influence. Since Neverland is a financially transp

2025-02-13 19:47:58 772

原创 Excavation ( [2020-2021 ICPC Central Europe Regional Contest (CERC 20)](gym104713) )

Excavation ( 2020-2021 ICPC Central Europe Regional Contest (CERC 20) )The police investigation revealed the gangsters deployed several radioactive stones under the city to poison underground waters. The exact positions of radioactive stones were found, b

2025-02-12 11:10:42 981

原创 Storage Problems ( [2020-2021 ICPC Central Europe Regional Contest (CERC 20)](gym104713) )

Storage Problems ( 2020-2021 ICPC Central Europe Regional Contest (CERC 20) )The gangsters did a very successful robbery of the city’s most famous auction house. Now they are safely at their hideout, where they store the stolen items. Luckily, you managed

2025-02-12 11:07:25 1086

原创 P4766 [CERC2014] Outer space invaders

P4766 [CERC2014] Outer space invaders题面翻译题目描述来自外太空的外星人(最终)入侵了地球。保卫自己,或者解体,被他们同化,或者成为食物。迄今为止,我们无法确定。

2025-02-10 20:41:55 548

原创 Human Resources ( 2023-2024 ICPC Central Europe Regional Contest (CERC 23) )

Human Resources ( 2023-2024 ICPC Central Europe Regional Contest (CERC 23) )You work at ECorp and your Human Resources department is migrating employee data from an on-premise system provided by Hooli to a new Cloud Native solution provided by a fresh sta

2025-02-10 20:41:00 392

贪心课程PPT 在对问题求解时,总是作出在当前看来是最好的选择 也就是说,不从整体上加以考虑,它所作出的仅仅是在某种意义上的局部

在对问题求解时,总是作出在当前看来是最好的选择。也就是说,不从整体上加以考虑,它所作出的仅仅是在某种意义上的局部最优解。 (是否是全局最优,需要证明)

2025-01-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除