![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforce
狠人王
怀着一颗热情的心,追随自己的梦想!
展开
-
【codeforce】补题 D1. Remove the Substring (easy version)
The only difference between easy and hard versions is the length of the string.You are given a stringssand a stringtt, both consisting only of lowercase Latin letters. It is guaranteed thatttc...原创 2019-12-05 15:12:49 · 219 阅读 · 0 评论 -
【ciodeforce】补题 D. Secret Passwords
One unknown hacker wants to get the admin's password of AtForces testing system, to get problems from the next contest. To achieve that, he sneaked into the administrator's office and stole a piec...原创 2019-12-04 19:16:44 · 280 阅读 · 1 评论 -
【codeforce】C. Almost Equal(构造)
如何构造出第一个图?#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e6;ll a[N+1000],b[N];int main(){ ll n,k=1; cin>>n; if(n&1) { for(i...原创 2019-10-25 21:03:05 · 187 阅读 · 0 评论 -
codeForces 242C.King's Path(BFS)
C. King’s Pathtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe black king is standing on a chess field consisting of 109 rows and 109 ...原创 2019-08-03 08:24:32 · 138 阅读 · 0 评论 -
【CodeForce】 626C Block Towers(二分)
Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the students use pieces made of two blocks and m of the ...原创 2019-08-04 22:56:54 · 187 阅读 · 0 评论 -
【codeforce】A. Important Exam(思维)
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA class of students wrote a multiple-choice test.There are nstudents in the class. The te...原创 2019-08-05 09:40:02 · 155 阅读 · 0 评论 -
【codeforce】A. BowWow and the Timetable(数学,二进制)
In the city of Saint Petersburg, a day lasts for21002100minutes. From the main station of Saint Petersburg, a train departs after11minute,44minutes,1616minutes, and so on; in other words, the t...原创 2019-08-21 10:00:35 · 177 阅读 · 0 评论 -
【codeforce】A. Nicholas and Permutation
Nicholas has an array a that contains n distinct integers from 1 to n. In other words, Nicholas has a permutation of size n.Nicholas want the minimum element (integer 1) and the maximum element (int...原创 2019-08-12 14:09:10 · 118 阅读 · 0 评论 -
【codeforce】1200C - Round Corridor
Amugae is in a very large round corridor. The corridor consists of two areas. The inner area is equally divided by n sectors, and the outer area is equally divided by msectors. A wall exists between ...原创 2019-08-12 14:35:57 · 223 阅读 · 0 评论 -
【CodeForces】-260B(字符串)
A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characters "-".We'll say that some date is mentioned in ...原创 2019-08-21 16:46:18 · 267 阅读 · 0 评论 -
【codeforce】1208A(异或斐波那契数列规律) and 1208B Uniqueness(div1+div2)(尺取(two pointers))(二分)(区间缩小思维)
【A】Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he namedXOR...原创 2019-08-26 11:26:13 · 663 阅读 · 0 评论 -
【codeforce】B. Sort the Array (翻转一次数串使得序列有序)
Being a programmer, you like arrays a lot. For your birthday, your friends have given you an arrayaconsisting ofndistinctintegers.Unfortunately, the size ofais too small. You want a bigger ar...原创 2019-08-27 15:17:41 · 228 阅读 · 0 评论 -
【codeforce】A. Chips Moving(规律)(~水)
You are givennnchips on a number line. Theii-th chip is placed at the integer coordinatexixi. Some chipscan have equal coordinates.You can perform each of the two following types of moves any (...原创 2019-09-04 08:38:00 · 321 阅读 · 0 评论 -
【CodeForces】思维,选择问题
The Bitlandians are quite weird people. They have very peculiar customs.As is customary, Uncle J. wants to haveneggs painted for Bitruz (an ancient Bitland festival). He has asked G. and A. to do ...原创 2019-09-05 21:43:44 · 271 阅读 · 0 评论 -
【CodeForces】 - 279E(贪心|DP)
Valera considers a numberbeautiful, if it equals2kor -2kfor some integerk(k ≥ 0). Recently, the math teacher asked Valera to represent numbernas the sum of beautiful numbers. As Valera is real...原创 2019-09-05 21:57:19 · 261 阅读 · 0 评论 -
【CodeForces】 1201B B - Zero Array(思维)
You are given an arraya1,a2,…,an.In one operation you can choose two elementsaiaiandajaj(i≠ji≠j) and decrease each of them by one.You need to check whether it is possible to make all the elem...原创 2019-09-14 19:05:11 · 191 阅读 · 0 评论 -
CodeForces - 236B(水,因子)
Let’s denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:Find the sum modulo 1073741824 (230).InputT...原创 2019-08-01 21:19:10 · 223 阅读 · 0 评论 -
CodeForces-233B(简单数学求根)
Let’s consider equation:x2 + s(x)·x - n = 0,where x, n are positive integers, s(x) is the function, equal to the sum of digits of number x in the decimal number system.You are given an integer n, f...原创 2019-07-31 21:35:44 · 237 阅读 · 0 评论 -
CodeForces-231D Problem C(思维,几何数学)
One day Vasya was going home when he saw a box lying on the road. The box can be represented as a rectangular parallelepiped. Vasya needed no time to realize that the box is special, as all its edges ...原创 2019-07-30 16:03:44 · 117 阅读 · 0 评论 -
CodeForce 222B 思维,易超时
The 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 movement.UC...原创 2019-07-27 15:52:04 · 398 阅读 · 0 评论 -
【codeforce】B. Equal Rectangles(贪心)
You are given4n4nsticks, the length of theii-th stick isaiai.You have to creatennrectangles, each rectangle will consist of exactly44sticks from the given set. The rectangle consists of four...原创 2019-08-14 08:58:56 · 410 阅读 · 0 评论 -
【codeforce】C. Maximum Median(规律)
DescriptionYou are given an array a of n integers, where nis odd. You can make the following operation with it:Choose one of the elements of the array (for example ai) and increase it by 1 (that is...原创 2019-08-09 14:56:57 · 608 阅读 · 0 评论 -
CodeForces - 255C (DP)
Gena loves sequences of numbers. Recently, he has discovered a new type of sequences which he called an almost arithmetical progression. A sequence is analmost arithmetical progression, if its elemen...原创 2019-08-20 11:22:26 · 112 阅读 · 0 评论 -
【codeforce】C. Common Divisors
You are given an arrayaaconsisting ofnnintegers.Your task is to say the number of such positive integersxxsuch thatxxdivideseachnumber from the array. In other words, you have to find the ...原创 2019-08-14 09:40:23 · 194 阅读 · 0 评论 -
【CodeForces】 - 259B (幻方规律)(水)
Little Elephant loves magic squares very much.Amagic squareis a3 × 3table, each cell contains some positive integer. At that the sums of integers in all rows, columns and diagonals of the table ...原创 2019-08-20 08:47:59 · 185 阅读 · 0 评论 -
【codeforce】D1. Remove the Substring (easy version)
he only difference between easy and hard versions is the length of the string.You are given a stringssand a stringtt, both consisting only of lowercase Latin letters. It is guaranteed thatttcan...原创 2019-08-14 10:21:36 · 190 阅读 · 0 评论 -
【codeforce】A. Circle of Students(思维)
There arennstudents standing in a circle in some order. The index of theii-th student ispipi. It is guaranteed that all indices of students are distinct integers from11tonn(i. e. they form a p...原创 2019-08-14 09:23:06 · 221 阅读 · 0 评论 -
【codeforce】B. Block Adventure(贪心)
Gildong is playing a video game called Block Adventure. In Block Adventure, there are n columns of blocks in a row, and the columns are numbered from 1 to n. All blocks have equal heights. The height ...原创 2019-08-12 11:20:28 · 281 阅读 · 0 评论 -
【CodeForce】A. Hotelier(思维)
Amugae has a hotel consisting of 10 rooms. The rooms are numbered from 0 to 9from left to right.The hotel has two entrances — one from the left end, and another from the right end. When a customer a...原创 2019-08-12 10:24:34 · 345 阅读 · 0 评论 -
【codeforce】A. Phone Numbers(water)
Let’s call a string a phone number if it has length 11 and fits the pattern “8xxxxxxxxxx”, where each “x” is replaced by a digit.For example, “80123456789” and “80000000000” are phone numbers, while ...原创 2019-08-10 17:32:57 · 231 阅读 · 0 评论 -
【codeforce】A. Tokitsukaze and Enhancement(水题)(规律)
Tokitsukaze is one of the characters in the game “Kantai Collection”. In this game, every character has a common attribute — health points, shortened to HP. In general, different values of HP are grou...原创 2019-08-10 09:31:53 · 161 阅读 · 0 评论 -
【CodeForces】222A - Shooshuns and Sequence(思维)
写这个题是提醒自己思维题千万不能停刷。比赛时这道题竟然花了我不少时间,其实规律很明显嘛。A. Shooshuns and Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day shooshuns f...原创 2019-07-27 15:30:32 · 227 阅读 · 0 评论 -
【codeforce】A. Thanos Sort(递归)
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThanos sort is a supervillain sorting algorithm, which works as follows: if the array is no...原创 2019-07-28 21:27:55 · 216 阅读 · 0 评论 -
CodeForce 231C To Add or Not to Add(前缀和贪心)
A piece of paper contains an array of n integers a1, a2, …, an. Your task is to find a number that occurs the maximum number of times in this array.However, before looking for such number, you are al...原创 2019-07-30 15:53:32 · 148 阅读 · 0 评论 -
【codeforce】B. Water Lily
While sailing on a boat, Inessa noticed a beautiful water lily flower above the lake’s surface. She came closer and it turned out that the lily was exactly H centimeters above the water surface. Iness...原创 2019-07-31 09:34:59 · 235 阅读 · 0 评论