![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模拟
文章平均质量分 78
i-unique
擅长各种姿势划水
展开
-
HDU 6205 card card card(展开字符串思想+思维)
As a fan of Doudizhu, WYJ likes collecting playing cards very much. One day, MJF takes a stack of cards and talks to him: let's play a game and if you win, you can get all these cards. MJF randomly assigns these cards into n heaps, arranges in a row, and原创 2017-09-10 17:46:13 · 1230 阅读 · 2 评论 -
Codeforces 276D. Little Girl and Maximum XOR(模拟)
A little girl loves problems on bitwise operations very much. Here's one of them.You are given two integers l and r. Let's consider the values of for all pairs of integers a and b (l ≤ a ≤ b ≤ r). Your task is to find the maximum value among all consider原创 2017-10-22 20:31:50 · 737 阅读 · 0 评论 -
CodeForces 292D Connected Components(变种并查集+预处理)
We already know of the large corporation where Polycarpus works as a system administrator. The computer network there consists of n computers and m cables that connect some pairs of computers. In other words, the computer network can be represented as some原创 2017-10-22 20:36:19 · 453 阅读 · 0 评论 -
Educational Codeforces Round 32 B. Buggy Robot(模拟)
Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0, 0). The robot can process commands. There are four types of commands it can perform:U — move from the cell (x, y) to (x, y + 1);D — move fro原创 2017-11-10 00:10:26 · 855 阅读 · 0 评论 -
Educational Codeforces Round 32 A. Local Extrema(模拟水题)
You are given an array a. Some element of this array ai is a local minimum iff it is strictly less than both of its neighbours (that is, ai < ai - 1and ai < ai + 1). Also the element can be called local maximum iff it is strictly greater than its neighbour原创 2017-11-10 00:08:25 · 442 阅读 · 0 评论 -
Educational Codeforces Round 32 C. K-Dominant Character(模拟)
You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least kcontains this character c.You have to find minimum k such that there exists at least one k-dominant character.原创 2017-11-10 00:12:22 · 795 阅读 · 0 评论 -
FZU 1857 Clock in the mirror(模拟)
Yr is on the English class,she is so sleepy that she want to know how long the class will last.So,she try to find out the current time.But the only clock is on the back wall of the classroom,and frequent turning might offend the teacher. Clever as she is,原创 2017-11-19 21:39:14 · 356 阅读 · 0 评论 -
SGU 417. Heavy Disc(水题)
Consider a heavy disc on the plane, centered at ( x 0, y 0) with radius r, with the origin strictly outside it. The density of the disc is given by formula What is the mass of the disc?原创 2017-11-19 21:35:49 · 271 阅读 · 0 评论 -
HDU 4393 Throw nails(技巧性模拟)
The annual school bicycle contest started. ZL is a student in this school. He is so boring because he can't ride a bike!! So he decided to interfere with the contest. He has got the players' information by previous contest video. A player can run F meters原创 2017-11-19 21:50:01 · 644 阅读 · 0 评论 -
CodeForces 165C Another Problem on Strings(公式推导)
A string is binary, if it consists only of characters "0" and "1".String v is a substring of string w if it has a non-zero length and can be read starting from some position in string w. For example, string "010" has six substrings: "0", "1", "0", "01", "原创 2017-12-19 22:45:55 · 491 阅读 · 0 评论 -
CodeForces 160C Find Pair(思维)
You've got another problem dealing with arrays. Let's consider an arbitrary sequence containing n (not necessarily different) integers a1, a2, ..., an. We are interested in all possible pairs of numbers (ai, aj), (1 ≤ i, j ≤ n). In other words, let's consi原创 2017-12-19 22:51:25 · 291 阅读 · 0 评论 -
Codeforces Round #438 (Div. 1 + Div. 2 combined) B. Race Against Time(模拟)
Have you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And this time he has a really strong excuse: he faced a space-time paradox! Space and time replaced each othe原创 2017-10-05 17:09:33 · 429 阅读 · 0 评论 -
Codeforces Round #438 (Div. 1 + Div. 2 combined) A. Bark to Unlock(模拟)
As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock its new phone, Arkady's pet dog Mu-mu has to bark the password once. The phone represents a password as a string of two lowercase Eng原创 2017-10-05 16:45:01 · 599 阅读 · 0 评论 -
HDU 6208 The Dominator of Strings(stl)
Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated by T if S is a substring of T.原创 2017-09-19 17:54:16 · 388 阅读 · 0 评论 -
hdu 5546 Ancient Go(bfs+模拟)
Yu Zhou likes to play Go with Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go. Here is the rules for ancient go they were playing: ⋅⋅The game is played on a 8×88×8 cell board, t原创 2017-09-19 21:12:58 · 524 阅读 · 0 评论 -
HDU 5551 Huatuo's Medicine(宇宙无敌炒鸡大水题)
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 these bottles together. However, there was a critical problem. When Huatuo arrived the pati原创 2017-09-19 21:26:15 · 371 阅读 · 0 评论 -
Codeforces Round #431 (Div. 2) B. Tell Your World(技巧性模拟+精度坑死人系列)
Connect the countless points with lines, till we reach the faraway yonder.There are n points on a coordinate plane, the i-th of which being (i, yi).Determine whether it's possible to draw two parallel and non-overlapping lines, such that every point in原创 2017-09-02 20:16:46 · 338 阅读 · 0 评论 -
HDU 5491 The Next(技巧性模拟)
Let LL denote the number of 1s in integer DD’s binary representation. Given two integers S1S1 and S2S2, we call DD a WYH number if S1≤L≤S2S1≤L≤S2. With a given DD, we would like to find the next WYH number YY, which is JUST larger than DD. In other words,原创 2017-09-12 21:27:44 · 280 阅读 · 0 评论 -
HDU 5547 Sudoku(dfs+模拟+状态判断)
Yi Sima was one of the best counselors of Cao Cao. He likes to play a funny game himself. It looks like the modern Sudoku, but smaller. Actually, Yi Sima was playing it different. First of all, he tried to generate a 4×44×4 board with every row contains原创 2017-09-19 21:18:38 · 358 阅读 · 0 评论 -
HDU 5533 Dancing Stars on Me (暴力模拟+思维)
The sky was brushed clean by the wind and the stars were cold in a black sky. What a wonderful night. You observed that, sometimes the stars can form a regular polygon in the sky if we connect them properly. You want to record these moments by your smart c原创 2017-09-21 20:32:21 · 284 阅读 · 0 评论 -
HDU 5536 Chip Factory(暴力+优化)
John is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage large amounts of products, every processor has a serial number. More specifically, the factory produces nn chips today, the ii-th chip produced this day has a s原创 2017-09-21 21:03:29 · 237 阅读 · 0 评论 -
Codeforces Round #443 (Div. 2) A. Borya's Diagnosis(水水的模拟)
It seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of the doctors needs the information about all previous visits, so Borya has to visit them in the prescribed order (i.e. Borya should first visit docto原创 2017-10-27 08:49:05 · 604 阅读 · 0 评论 -
Codeforces Round #443 (Div. 2) B. Table Tennis(模拟)
n people are standing in a line to play table tennis. At first, the first two players in the line play a game. Then the loser goes to the end of the line, and the winner plays with the next person from the line, and so on. They play until someone wins k ga原创 2017-10-27 08:51:15 · 564 阅读 · 0 评论 -
UVa 11401 Triangle Countin(找规律)
Triangle CountingInput: Standard InputOutput: Standard Output You are given n rods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangle原创 2017-12-03 22:39:41 · 222 阅读 · 0 评论 -
SPOJ PROOT Primitive Root (数学找规律)
PROOT - Primitive Root原创 2017-12-03 22:46:33 · 398 阅读 · 0 评论 -
CodeForces 144C Anagram Search(暴力模拟)
A string t is called an anagram of the string s, if it is possible to rearrange letters in t so that it is identical to the string s. For example, the string "aab" is an anagram of the string "aba" and the string "aaa" is not.The string t is called a subs原创 2017-12-05 22:25:44 · 347 阅读 · 0 评论 -
Codeforces 190D Non-Secret Cypher(尺取)
Berland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how many more flatland soldiers are left in the enemy's原创 2017-12-26 21:17:22 · 341 阅读 · 0 评论 -
Permutations(思维)
Happy PMP is freshman and he is learning about algorithmic problems. He enjoys playing algorithmic games a lot.One of the seniors gave Happy PMP a nice game. He is given two permutations of numbers原创 2017-12-26 21:40:34 · 492 阅读 · 0 评论 -
Codeforces 198A.About Bacteria(思维)
Qwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and conduct some experiments on bacteria that have funny and abnormal properties. The job isn't原创 2018-01-04 21:38:41 · 285 阅读 · 0 评论 -
Codeforces 196D Lexicographically Maximum Subsequence(模拟+哈希)
You've got string s, consisting of only lowercase English letters. Find its lexicographically maximum subsequence.We'll call a non-empty string s[p1p2... pk] = sp1sp2... spk(1 ≤ p1 p2 pk ≤ |s|) a su原创 2018-01-04 22:09:22 · 401 阅读 · 0 评论 -
Codeforces Good Bye 2017 C. New Year and Curling(模拟水题)
Carol is currently curling.She has n disks each with radius r on the 2D plane.Initially she has all these disks above the line y = 10100.She then will slide the disks towards the line y = 0 one by one in order from 1 to n.When she slides the i-th disk原创 2017-12-30 13:51:16 · 440 阅读 · 0 评论 -
旋转数组 LeetCode(思维+模拟)
给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。示例 1:输入: [1,2,3,4,5,6,7] 和 k = 3输出: [5,6,7,1,2,3,4]解释:向右旋转 1 步: [7,1,2,3,4,5,6]向右旋转 2 步: [6,7,1,2,3,4,5]向右旋转 3 步: [5,6,7,1,2,3,4]示例 2:输入: [-1,-100,3,...原创 2018-09-07 20:58:25 · 751 阅读 · 0 评论 -
有效的数独 LeetCode(数组的巧妙运用)
有效的数独判断一个 9x9 的数独是否有效。只需要根据以下规则,验证已经填入的数字是否有效即可。数字 1-9 在每一行只能出现一次。 数字 1-9 在每一列只能出现一次。 数字 1-9 在每一个以粗实线分隔的 3x3 宫内只能出现一次。上图是一个部分填充的有效的数独。数独部分空格内已填入了数字,空白格用 '.' 表示。示例 1:输入:[ ["5","3",...原创 2018-09-08 20:16:32 · 1350 阅读 · 0 评论 -
最长连续序列 LeetCode(思维)
给定一个未排序的整数数组,找出最长连续序列的长度。要求算法的时间复杂度为 O(n)。示例:输入: [100, 4, 200, 1, 3, 2]输出: 4解释: 最长连续序列是 [1, 2, 3, 4]。它的长度为 4。题解:一开始开了个100w的数组,然后暴力扫,结果说输入的数据有-2^31和2^31这种变态数据,后来好好想了,然后tle了,优化了下最后a了,不过才击败了...原创 2018-09-06 19:15:02 · 1175 阅读 · 0 评论 -
最长公共子括号序列(牛客网 网易2018校招题 思维+暴力)
链接:https://www.nowcoder.com/questionTerminal/504ad6420b314e5bb614e1684ad46d4d来源:牛客网一个合法的括号匹配序列被定义为:1. 空串""是合法的括号序列2. 如果"X"和"Y"是合法的序列,那么"XY"也是一个合法的括号序列3. 如果"X"是一个合法的序列,那么"(X)"也是一个合法的括号序列4. 每个原创 2018-09-10 15:47:59 · 383 阅读 · 0 评论 -
射击游戏(牛客网 网易2018校招题 思维+暴力)
小易正在玩一款新出的射击游戏,这个射击游戏在一个二维平面进行,小易在坐标原点(0,0),平面上有n只怪物,每个怪物有所在的坐标(x[i], y[i])。小易进行一次射击会把x轴和y轴上(包含坐标原点)的怪物一次性消灭。小易是这个游戏的VIP玩家,他拥有两项特权操作:1、让平面内的所有怪物同时向任意同一方向移动任意同一距离2、让平面内的所有怪物同时对于小易(0,0)旋转任意同一角度小易要进行...原创 2018-09-10 17:08:09 · 566 阅读 · 0 评论 -
Codeforces 185B(玄学)
As you very well know, the whole Universe traditionally uses three-dimensional Cartesian system of coordinates. In this system each point corresponds to three real coordinates (x, y, z). In this coordinate system, the distance between the center of the Uni原创 2017-12-26 21:09:12 · 350 阅读 · 0 评论 -
CodeForces 152C Pocket Book(找规律+哈希)
One day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written.As mom wasn't home, Vasya decided to pl原创 2017-12-07 23:02:12 · 338 阅读 · 0 评论 -
Codeforces 145A Lucky Conversion(思维)
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has two strings a and b of th原创 2017-12-05 22:28:24 · 275 阅读 · 0 评论 -
codeforces 148C Terse princess(有意思的模拟)
«Next please», — the princess called and cast an estimating glance at the next groom.The princess intends to choose the most worthy groom, this is, the richest one. Whenever she sees a groom who is more rich than each of the previous ones, she says a meas原创 2017-12-05 22:34:00 · 291 阅读 · 0 评论