![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 64
five_east_west
这个作者很懒,什么都没留下…
展开
-
航班时间——第9届蓝桥杯省赛A组
小 h 前往美国参加了蓝桥杯国际赛。小 h 的女朋友发现小 h 上午十点出发,上午十二点到达美国,于是感叹到“现在飞机飞得真快,两小时就能到美国了”。小 h 对超音速飞行感到十分恐惧。仔细观察后发现飞机的起降时间都是当地时间。由于北京和美国东部有 12 小时时差,故飞机总共需要 14 小时的飞行时间。不久后小 h 的女朋友去中东交换。小 h 并不知道中东与北京的时差。但是小 h 得到了女朋友来回航班的起降时间。小 h 想知道女朋友的航班飞行时间是多少。对于一个可能跨时区的航班,给定来回程的原创 2022-04-05 17:13:55 · 92 阅读 · 0 评论 -
vijos1041——神风堂人数
神风堂人数背景《风云》里有详细记载,自己去看吧_…描述天下会评选一级弟子,(做出10题以上的有机会参加评选)。最后评选结果神风堂有超过P%但不足Q%的人被评上了(弟子一:听起来像是URAL上的1011。风:闭嘴!!!)。现在给你P和Q,你要算出神风堂最少有多少人。(数据弱了一点,所以好通过)。格式输入格式两个实数P,Q。用空格隔开。每个数最多有两位小数。0.00<=p<q<=99.99输出格式神风堂最少的人数。...原创 2021-06-02 00:24:17 · 442 阅读 · 0 评论 -
Codeforces Round #675 (Div. 2) A.fence
A.fenceDescriptionYura is tasked to build a closed fence in shape of an arbitrary non-degenerate simple quadrilateral. He’s already got three straight fence segments with known lengths a, b, and c. Now he needs to find out some possible integer length d原创 2020-10-21 12:20:46 · 199 阅读 · 0 评论 -
Codeforces Round #675 (Div. 2) B. Nice Matrix
B. Nice MatrixA matrix of size n×m is called nice, if all rows and columns of the matrix are palindromes. A sequence of integers (a1,a2,…,ak) is a palindrome, if for any integer i (1≤i≤k) the equality ai=ak−i+1 holds.Sasha owns a matrix a of size n×m. In原创 2020-10-21 10:33:38 · 333 阅读 · 0 评论 -
2020年湖南ACM省赛第四题(D题)
2020年湖南ACM省赛第四题(D题)题意:第一行输入一个数字n,接下来n行输入n个字符串,给定一个合并两条字符串的规则(记为str1和str2),如果着两条字符串无论以何种顺序连接(s1+s2或s2+s1)它们形成的新的字符串都一样,则说明它两能够合并,能够合并的字符串的数量加一。最后输出总的能够合并的字符串的数量。题解: 利用哈希表来进行字符串的映射。详细逻辑见代码叉姐代码:#include <cstdio>#include <cstring>#include &原创 2020-10-20 17:23:12 · 809 阅读 · 0 评论 -
poj 2299 Ultra-QuickSort——归并排序
Ultra-QuickSortDescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. For the i原创 2020-10-13 16:56:44 · 278 阅读 · 0 评论 -
poj 1423 Big Number——斯特林公式
Big NumberDescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of di原创 2020-10-13 11:39:28 · 165 阅读 · 0 评论 -
poj 2503 Babelfish——字典映射
BabelfishDescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 100,000 dictionary原创 2020-10-13 10:40:23 · 353 阅读 · 0 评论 -
poj 1007DNA Sorting——冒泡排序
DNA SortingDescriptionOne measure of unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequenceDAABEC’’, this measure is 5, since D is greater than four letters to原创 2020-10-13 08:28:57 · 213 阅读 · 0 评论 -
Codeforces Round #675 (Div. 2) C. Bargain
文章转载自:https://blog.csdn.net/lmmmmmmmmmmmmmmm/article/details/108942614?utm_medium=distribute.pc_relevant.none-task-blog-title-1&spm=1001.2101.3001.4242C. BargainDescriptionSometimes it is not easy to come to an agreement in a bargain. Right now Sash转载 2020-10-10 16:02:33 · 182 阅读 · 0 评论 -
Grakn Forces 2020 C. Discrete Acceleration——二分查找
C. Discrete AccelerationDescriptionThere is a road with length l meters. The start of the road has coordinate 0, the end of the road has coordinate l.There are two cars, the first standing at the start of the road and the second standing at the end of t原创 2020-10-05 21:31:26 · 241 阅读 · 0 评论 -
Grakn Forces 2020 B. Arrays Sum
B. Arrays SumDescriptionYou are given a non-decreasing array of non-negative integers a1,a2,…,an. Also you are given a positive integer k.You want to find m non-decreasing arrays of non-negative integers b1,b2,…,bm, such that:The size of bi is equal to原创 2020-10-05 11:07:57 · 265 阅读 · 0 评论 -
Grakn Forces 2020 A. Circle Coloring
A. Circle ColoringDescriptionYou are given three sequences: a1,a2,…,an; b1,b2,…,bn; c1,c2,…,cn.For each i, ai≠bi, ai≠ci, bi≠ci.Find a sequence p1,p2,…,pn, that satisfy the following conditions:pi∈{ai,bi,ci}pi≠p(imodn)+1.In other words, for each el原创 2020-10-05 09:49:01 · 116 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) F. Number of Subsequences
F. Number of SubsequencesDescriptionYou are given a string s consisting of lowercase Latin letters “a”, “b” and “c” and question marks “?”.Let the number of question marks in the string s be k. Let’s replace each question mark with one of the letters “a原创 2020-10-03 19:34:54 · 103 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) E. Rock, Paper, Scissors
E. Rock, Paper, ScissorsDescriptionAlice and Bob have decided to play the game “Rock, Paper, Scissors”.The game consists of several rounds, each round is independent of each other. In each round, both players show one of the following things at the same转载 2020-10-03 09:10:34 · 204 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) D. Non-zero Segments
D. Non-zero SegmentsDescriptionKolya got an integer array a1,a2,…,an. The array can contain both positive and negative integers, but Kolya doesn’t like 0, so the array doesn’t contain any zeros.Kolya doesn’t like that the sum of some subsegments of his原创 2020-10-02 20:54:26 · 75 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) C. Increase and Copy
C. Increase and CopyDescriptionInitially, you have the array a consisting of one element 1 (a=[1]).In one move, you can do one of the following things:Increase some (single) element of a by 1 (choose some i from 1 to the current length of a and increas原创 2020-10-02 19:26:13 · 124 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) B. Symmetric Matrix
B. Symmetric MatrixDescriptionMasha has n types of tiles of size 2×2. Each cell of the tile contains one integer. Masha has an infinite number of tiles of each type.Masha decides to construct the square of size m×m consisting of the given tiles. This sq原创 2020-10-02 17:12:55 · 194 阅读 · 0 评论 -
Codeforces Round #673 (Div. 1) C. XOR Inverse(代码暂时没搞懂,先放这儿)
C. XOR InverseDescriptionYou are given an array a consisting of n non-negative integers. You have to choose a non-negative integer x and form a new array b of size n according to the following rule: for all i from 1 to n, bi=ai⊕x (⊕ denotes the operation转载 2020-10-01 17:11:07 · 225 阅读 · 0 评论 -
Codeforces Round #673 (Div. 2) D. Make Them Equal
D. Make Them EqualDescriptionYou are given an array a consisting of n positive integers, numbered from 1 to n. You can perform the following operation no more than 3n times:choose three integers i, j and x (1≤i,j≤n;0≤x≤109)1≤i,j≤n; 0≤x≤10^9)1≤i,j≤n;0≤x原创 2020-10-01 00:22:57 · 123 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2) D. Rescue Nibel!
D. Rescue Nibel!DescriptionOri and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins… nothing happened.Ori was very surpr原创 2020-09-27 18:54:57 · 147 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2) B. Rock and Lever
B. Rock and LeverDescriptionDanik 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.Y原创 2020-09-26 16:34:06 · 123 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2) A. Cubes Sorting
A. Cubes SortingWheatley 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原创 2020-09-26 14:40:32 · 94 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) E. Decryption
E. DecryptionDescriptionAn agent called Cypher is decrypting a message, that contains a composite number n. All divisors of n, which are greater than 1, are placed in a circle. Cypher can choose the initial order of numbers in the circle.In one move Cyp原创 2020-09-26 00:56:37 · 150 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) D2. Sage‘s Birthday (hard version)
D2. Sage’s Birthday (hard version)DescriptionThis 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.原创 2020-09-24 09:20:51 · 91 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) C. Killjoy
C. KilljoyDescriptionA 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-09-23 21:15:18 · 136 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2) B. Stairs
DescriptionJett is tired after destroying the town and she wants to have a rest. She likes high places, that’s why for having a rest she wants to get high and she decided to craft staircases.A staircase is a squared figure that consists of square cells.原创 2020-09-23 20:02:54 · 304 阅读 · 1 评论 -
Codeforces Round #671 (Div. 2) A.Digit Game
A.Digit GameDescriptionEveryone knows that agents in Valorant decide, who will play as attackers, and who will play as defenders. To do that Raze and Breach decided to play t matches of a digit game…In each of t matches of the digit game, a positive int原创 2020-09-23 17:16:23 · 280 阅读 · 0 评论 -
牛客小白月赛28 F-牛牛的健身运动——二分查找
牛牛的健身运动题目描述还有m天,牛牛和牛可乐将进行马拉松大赛,冠亚军将在他两个之中选出,牛牛比较自信,所以这m天他准备选其中一天来健身房锻炼一下自己。牛牛来到健身房,总共有n种健身器材,因为牛牛体力有限,他只能选两种健身器材进行锻炼,从今天开始为第一天,第k(1<=k<=m){}k(1<=k<=m)天第i种器材会增加牛牛k*a_i+b_ik∗ai +bi 的力量,但是牛可乐为了胜利想要阻止牛牛进行锻炼,所以每天都会来健身房把当天健身器材全部拿走,为了不让牛牛发现原创 2020-09-23 11:29:22 · 184 阅读 · 0 评论 -
牛客小白月赛28 D-位运算之谜
位运算之谜题目描述a+b的值为x,a&b的值为y,首先需要判断能否有一组a,b满足当前的情况,如果有,那么求出a xor b,否则输出-1(其中a,b>0)输入描述:第一行为一个正整数t,表示组数{}第一行为一个正整数t,表示组数(t<=2×105t<=2×10^5t<=2×105)(t<=2×105t<=2×10^5t<=2×105)接下来t行,每一行有两个整数x,y接下来t行,每一行有两个整数x,y(0<=x,y<=1×101原创 2020-09-22 22:01:16 · 265 阅读 · 0 评论 -
牛客小白月赛28 B-牛牛和牛可乐的赌约2——找规律
牛牛和牛可乐的赌约2题目描述牛牛感觉在上一次赌约中,情况对于自己非常不利,所以决定再赌一场。这时候,牛蜓队长出现了:第一,绝对不意气用事;第二,绝对不漏判任何一件坏事;第三,绝对裁判的公正漂亮。牛蜓队长带他们来到了一个棋盘游戏,棋盘左上角是(0,0)(0,0),这个棋盘在(x,y)(x,y)的位置有一个棋子,牛牛和牛可乐轮流移动这个棋子,这个棋子可以左移也可以上移,可以移动一格或者两格,直到不能再移动(即到(0,0)(0,0))的那个人算输。如果原本在(x,y)(x,y),左移一格即为(x,y -原创 2020-09-22 19:37:38 · 223 阅读 · 0 评论 -
牛客假日团队赛54-K Cow Routing II
Cow Routing II题目描述Tired of the cold winter weather on her farm, Bessie the cow plans to fly to a warmer destination for vacation. Unfortunately, she discovers that only one airline, Air Bovinia, is willing to sell tickets to cows, and that these tickets原创 2020-09-21 19:46:57 · 292 阅读 · 0 评论 -
牛客假日团队赛54-L Cow routing
Cow routing题目描述Tired of the cold winter weather on her farm, Bessie the cow plans to fly to a warmer destination for vacation. Unfortunately, she discovers that only one airline, Air Bovinia, is willing to sell tickets to cows, and that these tickets are原创 2020-09-21 17:02:38 · 141 阅读 · 0 评论 -
牛客假日团队赛54 I-Meeting Time——图的遍历
Meeting Time题目描述Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly the same time from the barn, and also arrive at exactly the same time at their favorite field.The farm is a collection of N原创 2020-09-21 15:33:32 · 196 阅读 · 0 评论 -
vijos 1042 捕风捉影——回文素数
捕风捉影背景《风云》里有详细记载,自己去看吧_…描述有一天,雄霸传授本人风神腿法第一式:捕风捉影…的步法(弟子一:堂主,你大喘气呀。风:你给我闭嘴。)捕风捉影的关键是换气(换不好就会大喘气…)。使用捕风捉影这一招时并不是每一步都喘气,而是在特定的步数喘气。一般来说功力越高,喘气越稀疏。喘气的步数符合特定规律:第一要是SUSHU(弟子二:哇塞!堂主,你还会鸟语,我好好崇拜你呦!可是SUSHU是什么意思呢?风:笨蛋,那是汉语拼音!)第二要是一个回文数,回文数就是正反念一样的数,如:123321,121原创 2020-09-14 15:41:35 · 351 阅读 · 0 评论 -
Packets——包裹打包 贪心
转载于:https://www.cnblogs.com/ECJTUACM-873284962/p/6414760.htmlPacketsA factory produces products packed in square packets of the same height h and of the sizes 11, 22, 33, 44, 55, 66. These products are always delivered to customers in the square parcels转载 2020-08-15 10:57:54 · 408 阅读 · 0 评论 -
Big Number(大数求余)( 杭电ACM省赛集训队选拔赛之热身赛)
As we know, Big Number is always troublesome. But it’s really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 100000.Is it too hard? No, I work it out原创 2020-07-27 17:44:34 · 231 阅读 · 1 评论 -
SOLDIERS(poj1723 排序/中位数/货舱选址问题扩展)
DescriptionN soldiers of the land Gridland are randomly scattered around the country.A position in Gridland is given by a pair (x,y) of integer coordinates. Soldiers can move - in one move, one soldier can go one unit up, down, left or right (hence, he c原创 2020-07-25 11:38:14 · 246 阅读 · 0 评论 -
货舱选址
来源: 《算法竞赛进阶指南》, 模板题算法标签 排序,贪心题目描述在一条数轴上有 N 家商店,它们的坐标分别为 A1~AN。现在需要在数轴上建立一家货仓,每天清晨,从货仓到每家商店都要运送一车商品。为了提高效率,求把货仓建在何处,可以使得货仓到每家商店的距离之和最小。输入格式第一行输入整数N。第二行N个整数A1~AN。输出格式输出一个整数,表示距离之和的最小值。数据范围1≤N≤100000输入样例:46 2 9 1输出样例:12思路已知一条数轴上有 N 家商店,它们原创 2020-07-25 11:37:19 · 263 阅读 · 0 评论 -
codeforces1355 C. Count Triangles
codeforces1355 C. Count Triangles time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard outputLike any unknown mathematician, Yuri has favourite numbers: A ,B, C, and原创 2020-07-12 22:28:31 · 258 阅读 · 0 评论