
水题集
文章平均质量分 53
Baiyi_destroyer
记录过,回望来时路
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode 500. 键盘行
给你一个字符串数组 words ,只返回可以使用在 美式键盘 同一行的字母打印出来的单词。键盘如下图所示。美式键盘 中:第一行由字符 “qwertyuiop” 组成。第二行由字符 “asdfghjkl” 组成。第三行由字符 “zxcvbnm” 组成。示例 1:输入:words = [“Hello”,“Alaska”,“Dad”,“Peace”]输出:[“Alaska”,“Dad”]示例 2:输入:words = [“omk”]输出:[]示例 3:输入:words = [“adsdf原创 2021-05-25 22:51:58 · 195 阅读 · 0 评论 -
Summarize to the Power of Two(CodeForces - 1005C )
A sequence a1,a2,…,ana1,a2,…,an is called good if, for each element aiai, there exists an element ajaj (i≠ji≠j) such that ai+ajai+aj is a power of two (that is, 2d2d for some non-negative integer dd)....原创 2018-07-30 21:48:13 · 301 阅读 · 0 评论 -
Planning The Expedition(codeforces 1011B)
DescriptionNatasha is planning an expedition to Mars for nn people. One of the important tasks is to provide food for each participant.The warehouse has mm daily food packages. Each package has so...原创 2018-08-05 15:51:01 · 285 阅读 · 0 评论 -
Sonya and Robots(CodeForces 1004A)
DescriptionSonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.The country where Sonya lives is an endless line. Th...原创 2018-08-09 18:58:12 · 229 阅读 · 0 评论 -
Sonya and Exhibition(CodeForces 1004B)
DescriptionSonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers should be in this exhibition.There are n...原创 2018-08-10 00:08:20 · 450 阅读 · 0 评论 -
从零开始的异世界生活(SDUT 3915)
Description486 作为有史以来最悲惨的男主,我们知道他需要经历一些无限次的死亡和轮回才能进行下一个关卡。 现在给你 n 个连续的时间点,每个时间点 i 上都会有一个心理伤害值 hurt[i],然后告诉你 m 个死亡时间点 deth[i],以及当前死亡时间点会死亡的次数 num[i],和死亡后 486 会返回的时间点(也就是最近的存档点 return[i])。 ...原创 2018-07-23 10:43:25 · 315 阅读 · 1 评论 -
Segment Occurrences(codeforces 1016B)
DescriptionYou are given two strings ss and tt, both consisting only of lowercase Latin letters.The substring s[l..r]s[l..r] is the string which is obtained by taking characters sl,sl+1,…,srsl,sl+...原创 2018-08-10 00:19:14 · 479 阅读 · 0 评论 -
If at first you don't succeed...(CodeForces 991A)(简单容斥)
DescriptionEach student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from t...原创 2018-08-10 00:23:01 · 260 阅读 · 0 评论 -
Polycarp's Pockets (cf 1003A)
Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.For e...原创 2018-08-14 15:20:16 · 310 阅读 · 0 评论 -
Badge(cf 1020B)
In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of nn students doing yet another trick.Let's assume th...原创 2018-08-14 16:08:05 · 350 阅读 · 0 评论 -
New Building for SIS(cf 1020A)
You are looking at the floor plan of the Summer Informatics School's new building. You were tasked with SIS logistics, so you really care about travel time between different locations: it is important...原创 2018-08-14 16:18:06 · 280 阅读 · 0 评论 -
Turn the Rectangles(CodeForces 1008B)
There are nn rectangles in a row. You can either turn each rectangle by 9090 degrees or leave it as it is. If you turn a rectangle, its width will be height, and its height will be width. Notice that ...原创 2018-08-03 23:52:43 · 198 阅读 · 0 评论 -
Intense Heat(CodeForces 1003C)
The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But an...原创 2018-07-27 08:29:39 · 218 阅读 · 0 评论 -
Binary String Constructing(CodeForces 1003B)
You are given three integers aa, bb and xx. Your task is to construct a binary string ss of length n=a+bn=a+bsuch that there are exactly aa zeroes, exactly bb ones and exactly xx indices ii (where 1≤i...原创 2018-07-26 21:43:20 · 234 阅读 · 0 评论 -
Subsequence
DescriptionA sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the min...原创 2018-07-17 20:31:25 · 232 阅读 · 0 评论 -
最短的包含字符串
Description给出一个字符串,求该字符串的一个子串s,s包含A-Z中的全部字母,并且s是所有符合条件的子串中最短的,输出s的长度。如果给出的字符串中并不包括A-Z中的全部字母,则输出No Solution。Input第1行,1个字符串。字符串的长度 <= 100000。Output输出包含A-Z的最短子串s的长度。如果没有符合条件的子串,则输出No Solutio...原创 2018-07-17 20:35:52 · 818 阅读 · 1 评论 -
与7无关的数
Description一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7,则称其为与7相关的数。求所有小于等于N的与7无关的正整数的平方和。例如:N = 8,<= 8与7无关的数包括:1 2 3 4 5 6 8,平方和为:155。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 1000) 第2 - T + ...原创 2018-07-17 20:39:39 · 1174 阅读 · 0 评论 -
校赛~校赛~(SDUT 3914)
DescriptionSDUT 的校赛是从 2009 年开始的,康纳每年看到比赛之后,往往就会喊一声 “ma ji ya ba ku nai + 年份的缩写”。比如说 2009 年就会说 “ma ji ya ba ku nai 9”。年份的缩写是一个字符串形式的,但是如果当前选择的字符串以前已经被用过,就会再向前继续取,比如说 2019 年的话康纳一开始会选择 9 但是 9 已经被用过了,所以...转载 2018-07-23 15:35:11 · 205 阅读 · 0 评论 -
Max Sum (hdu 1003)
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. InputThe...原创 2018-07-25 11:21:14 · 215 阅读 · 0 评论 -
Alphabetic Removals(CodeForces - 999C )
You are given a string ss consisting of nn lowercase Latin letters. Polycarp wants to remove exactly kk characters (k≤nk≤n) from the string ss. Polycarp uses the following algorithm kk times:if ther...原创 2018-07-19 21:18:35 · 463 阅读 · 0 评论 -
Friends and Cookies
Abood's birthday has come, and his n friends are aligned in a single line from 1 to n, waiting for their cookies, Abood has x cookies to give to his friends.Here is an example to understand how Aboo...原创 2018-07-29 14:27:04 · 390 阅读 · 0 评论 -
二分练习(SDUT 2781 )
Description给你一个序列,然后给你m个元素,让你从序列中找出与每个元素最接近的数字输出来,如果有两个就输出两个。 Input 多组输入,第一行给你两个数n(0 < n < 10000000),m(0 < m < n),接下来是数列的n个数,然后再输入m个元素,让你找出最接近每个元素的值。如果有两个,按从小到大输出。 Output 这m个...原创 2018-07-20 23:00:56 · 357 阅读 · 0 评论 -
二分查找
Description给出含有n个数的升序序列,保证序列中的数两两不相等,这n个数编号从1 到n。然后给出q次询问,每次询问给出一个数x,若x存在于此序列中,则输出其编号,否则输出-1。Input单组输入。首先输入一个整数n(1 <= n && n <= 3000000),接下的一行包含n个数。再接下来的一行包含一个正整数q(1 <= q &a...原创 2018-07-20 23:09:30 · 166 阅读 · 0 评论 -
Flip the Bits
You are given a positive integer n. Your task is to build a number m by flipping the minimum number of bits in the binary representation of nsuch that m is less than n (m < n) and it is as maximal ...原创 2018-07-30 08:45:50 · 467 阅读 · 0 评论 -
Visiting a Friend(CodeForces 902A )
DescriptionPig is visiting a friend.Pig's house is located at point 0, and his friend's house is located at point m on an axis.Pig can use teleports to move along the axis.To use a teleport, P...原创 2018-08-12 16:12:47 · 354 阅读 · 0 评论 -
Romaji (CodeForces - 1008A )
Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o", "u", "i", and "e". Other letters are consonant.In Berlanese, there...原创 2018-10-01 16:46:22 · 367 阅读 · 0 评论 -
Which Base is it Anyway?(UVALive 7783)
DescriptionProgramming languages such as C++ and Java can prefix characters to denote the base of constantinteger values. For example, hexadecimal (base 16) constants are preceded by the string “0...原创 2018-11-12 20:22:12 · 242 阅读 · 0 评论 -
FBI Universal Control Numbers(UVALive 7784)
DescriptionThe FBI has recently changed its Universal Control Numbers (UCN) for identifying individuals whoare in the FBI’s fingerprint database to an eight digit base 27 value with a ninth check ...原创 2018-11-12 20:26:29 · 401 阅读 · 0 评论 -
ACM Contest Scoring(UVALive 7350)
DescriptionOur new contest submission system keeps a chronological log of all submissions made by each teamduring the contest. With each entry, it records the number of minutes into the competitio...原创 2018-11-12 20:35:55 · 294 阅读 · 0 评论 -
Hidden Password(UVALive 7353)
DescriptionInsecure Inc. has decided to shift directions after a failed attempt at developing a new encryptionstandard. Their new effort is a password system used to hide a password inside another...原创 2018-11-12 20:42:01 · 561 阅读 · 0 评论 -
A Rational Sequence (Take 3)(UVALive 7786)
DescriptionAn infinite full binary tree labeled by positive rational numbers is defined by:• The label of the root is 1/1.• The left child of label p/q is p/(p+q).• The right child of label p/q i...原创 2018-11-14 19:51:55 · 417 阅读 · 0 评论 -
Positive Con Sequences(UVALive 7295)
DescriptionYour younger sister is studying for an upcoming standardized test in mathematics. She needs practicewith the common style of problem in which the student is asked to fill in the missing ...原创 2018-11-20 11:54:02 · 367 阅读 · 0 评论 -
Help cupid(UVALive 6828)
DescriptionCupid’s job is getting harder, so he is adopting new technologies to help him with his difficult task ofmatching people into happy couples. He appointed the best programmers in his staff...原创 2018-11-25 19:41:51 · 333 阅读 · 0 评论 -
Chip Factory(UVALive 7192)
DescriptionJohn is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage largeamounts of products, every processor has a serial number. More specifically, the fact...原创 2019-02-02 20:29:52 · 325 阅读 · 0 评论 -
完全k叉树(CCPC-Wannafly & Comet OJ 夏季欢乐赛(2019) A)
题目描述欢迎报考JWJU!这里有丰富的社团活动,比如为梦想奋斗的ACM集训队,经常组织飞行棋的桌游协会,喜欢“唱,跳,rap,篮球”的篮球协会,更奇特的是——让人耳目一新的攀树协会。顾名思义,攀树协会会经常组织大家攀爬一些树,比如李超树,左偏树,带花树,智慧树等等。经过社团组织的一番培训后,同学们已经学会了如何在树上的相邻结点中来回爬动。不过上述的树太没意思了,RegenFallen同学向...原创 2019-07-29 08:09:54 · 482 阅读 · 0 评论 -
Garbage Disposal
DescriptionEnough is enough. Too many times it happened that Vasya forgot to dispose of garbage and his apartment stank afterwards. Now he wants to create a garbage disposal plan and stick to it....原创 2018-10-22 21:30:37 · 720 阅读 · 0 评论 -
Filya and Homework(CodeForces 714B)
DescriptionToday, hedgehog Filya went to school for the very first time! Teacher gave him a homework which Filya was unable to complete without your help.Filya is given an array of non-negative in...原创 2018-10-06 16:41:42 · 439 阅读 · 0 评论 -
Tritonic Iridescence(cf 957A)
Overlooking the captivating blend of myriads of vernal hues, Arkady the painter lays out a long, long canvas.Arkady has a sufficiently large amount of paint of three colours: cyan, magenta, and yell...原创 2018-08-15 22:31:26 · 535 阅读 · 0 评论 -
Aramic script(cf 975A)
In Aramic language words can only represent objects.Words in Aramic have special properties:A word is a root if it does not contain the same letter more than once. A root and all its permutations...原创 2018-08-16 10:52:26 · 493 阅读 · 0 评论 -
Code obfuscation(水题)
DescriptionKostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That's why he decided to obfuscate (intentionally make less reada...原创 2018-04-01 11:45:37 · 359 阅读 · 0 评论