
思维
爱吃老谈酸菜的DV
选择适合自己的。
展开
-
找假币(思维)
DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and size make it indistinguishable...原创 2019-12-17 19:26:07 · 516 阅读 · 0 评论 -
Codeforces Round #605 (Div. 3):D. Remove One Element【思维+DP?】
DiscriptionYou are given an array a consisting of n integers.You can remove at most one element from this array. Thus, the final length of the array is n−1 or n.DYour task is to calculate the maxim...原创 2019-12-13 21:19:34 · 242 阅读 · 0 评论 -
CodeForces - 1255A:Send Boxes to Alice (Easy Version)【思维、中位数】
DiscriptionBob watches TV every day. He always sets the volume of his TV to b. However, today he is angry to find out someone has changed the volume to a. Of course, Bob has a remote control that can...原创 2019-11-20 23:32:14 · 177 阅读 · 0 评论 -
CodeForces 1243B2:Character Swap (Hard Version)【思维题】
DiscriptionThis problem is different from the easy version. In this version Ujan makes at most 2n swaps. In addition, k≤1000,n≤50 and it is necessary to print swaps themselves. You can hack this prob...原创 2019-11-13 21:44:49 · 260 阅读 · 0 评论 -
CodeForces - 252C:Points on Line(暴力,优化)
DiscriptionLittle Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the d...原创 2019-08-10 23:23:17 · 262 阅读 · 0 评论 -
CodeForces - 252B: Unsorting Array(思维,STL,有个地方不太懂)
DiscriptonLittle Petya likes arrays of integers a lot. Recently his mother has presented him one such array consisting of n elements. Petya is now wondering whether he can swap any two distinct integ...原创 2019-08-10 23:35:33 · 230 阅读 · 0 评论 -
CodeForces - 253D:Table with Letters - 2(矩阵前缀和)
DiscriptionVasya has recently started to learn English. Now he needs to remember how to write English letters. He isn’t sure about some of them, so he decided to train a little.He found a sheet of s...原创 2019-08-15 22:02:59 · 262 阅读 · 0 评论 -
CodeForces - 254B:Jury Size(思维、模拟)
DiscriptionIn 2013, the writers of Berland State University should prepare problems for n Olympiads. We will assume that the Olympiads are numbered with consecutive integers from 1 to n. For each Oly...原创 2019-08-17 23:28:14 · 353 阅读 · 0 评论 -
CodeForces - 254C: Anagram(字符串,思维)
DiscriptionString x is an anagram of string y, if we can rearrange the letters in string x and get exact string y. For example, strings “DOG” and “GOD” are anagrams, so are strings “BABA” and “AABB”,...原创 2019-08-18 00:11:18 · 270 阅读 · 0 评论 -
CodeForces - 248B :Chilly Willy(规律,思维)
DiscriptionChilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up with a...原创 2019-08-09 23:38:53 · 310 阅读 · 0 评论 -
CodeForces - 253C:Text Editor(暴力枚举)
DiscriptionVasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicted in Homer’s Odysseus… How can he explain to his literature teacher that he isn...原创 2019-08-13 22:57:31 · 260 阅读 · 0 评论 -
Codeforces 239C:Not Wool Sequences(规律,快速幂)
题意输入一个n和m,要求从0道2^m-1中取出n个数进行逐个异或,求出最后的异或值不为0 的情况数,并且任意一个子区间的异或值也不能为0。可以取重复的数。思路列举:任何情况下,0做一个子区间,一定会出现0的情况,所以任何时候都不选0;n=1时,不能为0,所以有2^m-1中情况;n=2时,第一位有2^m-1种情况,第二位和第一位不相等, 第二位2^m-2种情况;n=3时,第一...原创 2019-08-06 23:15:40 · 228 阅读 · 0 评论 -
CodeForces - 234C:Weather(思维)
DiscriptionScientists say a lot about the problems of global warming and cooling of the Earth. Indeed, such natural phenomena strongly influence all life on our planet.Our hero Vasya is quite concer...原创 2019-07-30 22:51:02 · 249 阅读 · 0 评论 -
CodeForces - 227A:Where do I Turn?(思维题)
DiscriptionTrouble came from the overseas lands: a three-headed dragon Gorynych arrived. The dragon settled at point C and began to terrorize the residents of the surrounding villages.A brave hero d...原创 2019-07-26 10:37:28 · 267 阅读 · 0 评论 -
CodeForces - 237A: Free Cash(水题,边界!)
DisciptionValera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at hi hours mi mi...原创 2019-08-03 23:44:05 · 230 阅读 · 0 评论 -
CodeForces - 237C:Primes on Interval(筛素数、前缀和、不完全暴力)
DiscriptionYou’ve decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is a positive integer that has exactly two distinct positive integer divisors.Co...原创 2019-08-03 23:57:40 · 173 阅读 · 0 评论 -
CodeForces - 222B:Cosmic Tables(暴力优化)
DiscriptionThe Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this ...原创 2019-07-26 22:45:31 · 210 阅读 · 0 评论 -
CodeForces - 225E:Unsolvable(思维、快速幂)
Consider the following equation:where sign [a] represents the integer part of number a.Let’s find all integer z (z > 0), for which this equation is unsolvable in positive integers. The phrase “u...原创 2019-07-28 00:13:22 · 639 阅读 · 0 评论 -
AcWing103. 电影:排序(一道卡超时卡的我自闭的题)
题目描述莫斯科正在举办一个大型国际会议,有n个来自不同国家的科学家参会。每个科学家都只懂得一种语言。为了方便起见,我们把世界上的所有语言用1到109之间的整数编号。在会议结束后,所有的科学家决定一起去看场电影放松一下。他们去的电影院里一共有m部电影正在上映,每部电影的语音和字幕都采用不同的语言。对于观影的科学家来说,如果能听懂电影的语音,他就会很开心;如果能看懂字幕,他就会比较开心;如...原创 2019-08-08 23:23:36 · 1294 阅读 · 0 评论 -
Codeforces 239D:Boring Partition(思维)
DiscriptionThis problem is the most boring one you’ve ever seen.Given a sequence of integers a1, a2, …, an and a non-negative integer h, our goal is to partition the sequence into two subsequences (...原创 2019-08-06 23:00:33 · 183 阅读 · 0 评论 -
CodeForces - 224B:Array(思维题)
DiscriptionYou’ve got an array a, consisting of n integers: a1, a2, …, an. Your task is to find a minimal by inclusion segment [l, r] (1 ≤ l ≤ r ≤ n) such, that among numbers al, al + 1, …, ar the...原创 2019-07-25 09:05:50 · 504 阅读 · 0 评论