![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces
dream_it_
一切都是最好的安排
展开
-
1138A A. Sushi for Two
Arkady invited Anna for a dinner to a sushi restaurant. The restaurant is a bit unusual: it offers n pieces of sushi aligned in a row, and a customer has to choose a continuous subsegment of these sus...原创 2019-03-21 14:51:44 · 472 阅读 · 0 评论 -
1178A A. Prime Minister
A. Prime Ministertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice is the leader of the State Refactoring Party, and she is about to becom...原创 2019-07-24 09:13:13 · 307 阅读 · 0 评论 -
1201C C. Maximum Median
C. Maximum Median time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputYou are given an array a of n integers, where...原创 2019-08-05 19:36:54 · 753 阅读 · 0 评论 -
1201 B B. Zero Array
B. Zero Array time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputYou are given an array a1,a2,…,an.In one o...原创 2019-08-05 19:43:36 · 260 阅读 · 0 评论 -
1201A A. Important Exam
A. Important Exam time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputA class of students wrote a multiple...原创 2019-08-05 19:48:43 · 417 阅读 · 0 评论 -
cf 1199A A. City Day
A. City Daytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor years, the Day of city N was held in the most rainy day of summer. New mayor de...原创 2019-08-01 16:58:31 · 243 阅读 · 0 评论 -
cf1198A A. MP3
A. MP3 time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputOne common way of digitalizing sound is to record sound in...原创 2019-08-01 18:05:46 · 339 阅读 · 0 评论 -
cf1198B B. Welfare State(线段树单点修改加区间修改)
B. Welfare Statetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a country with n citizens. The i-th of them initially has ai money. ...原创 2019-08-01 18:22:21 · 256 阅读 · 0 评论 -
1199B B. Water Lily
B. Water Lilytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile sailing on a boat, Inessa noticed a beautiful water lily flower above the l...原创 2019-08-01 18:32:41 · 175 阅读 · 0 评论 -
cf1203E E. Boxers
E. Boxerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n boxers, the weight of the i-th boxer is ai. Each of them can change the ...原创 2019-08-15 10:50:56 · 395 阅读 · 0 评论 -
cf1203C C. Common Divisors
C. Common Divisorstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a consisting of n integers.Your task is to say the ...原创 2019-08-15 10:54:54 · 177 阅读 · 0 评论 -
cf1203B B. Equal Rectangles
B. Equal Rectanglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given 4n sticks, the length of the i-th stick is ai.You have to c...原创 2019-08-15 11:01:53 · 205 阅读 · 0 评论 -
cf1203A A. Circle of Students
A. Circle of Studentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n students standing in a circle in some order. The index of th...原创 2019-08-15 11:08:43 · 283 阅读 · 3 评论 -
cf1203D1&1203D2 D1. Remove the Substring (easy version)&D2. Remove the Substring (hard version)
D2. Remove the Substring (hard version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe only difference between easy and hard versions is ...原创 2019-08-15 11:48:55 · 494 阅读 · 1 评论 -
cf1208B B. Uniqueness
B. Uniquenesstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1,a2,…,an. You can remove at most one subsegment from it...原创 2019-08-26 15:36:18 · 869 阅读 · 0 评论 -
cf1208A A. XORinacci
A. XORinaccitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCengiz recently learned Fibonacci numbers and now he is studying different algorit...原创 2019-08-26 15:44:35 · 420 阅读 · 0 评论 -
cf1214A A. Optimal Currency Exchange
A. Optimal Currency Exchange time limit per test1.5 seconds memory limit per test512 megabytes inputstandard input outputstandard outputAndrew was v...原创 2019-09-05 09:12:47 · 430 阅读 · 0 评论 -
cf1214B B. Badges
B. Badges time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard outputThere are b boys and g girls participating in Olympiad of Met...原创 2019-09-05 09:18:04 · 428 阅读 · 0 评论 -
1178C C. Tiles
C. Tilestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBob is decorating his kitchen, more precisely, the floor. He has found a prime candida...原创 2019-07-24 08:50:29 · 754 阅读 · 2 评论 -
1178B B. WOW Factor
B. WOW Factortime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecall that string a is a subsequence of a string b if a can be obtained from b b...原创 2019-07-24 08:46:13 · 352 阅读 · 0 评论 -
1197C C. Array Splitting
You are given a sorted array a1,a2,…,an (for each index i>1 condition ai≥ai−1 holds) and an integer k.You are asked to divide this array into k non-empty consecutive subarrays. Every element in th...原创 2019-07-23 21:50:56 · 352 阅读 · 0 评论 -
1140C C.Playlist(优先队列的应用)
You have a playlist consisting of n songs. The i-th song is characterized by two numbers ti and bi — its length and beauty respectively. The pleasure of listening to set of songs is equal to the total...原创 2019-03-24 21:59:55 · 273 阅读 · 0 评论 -
1139A A. Even Substrings(找规律)
You are given a string s=s1s2…sn of length n, which only contains digits 1, 2, …, 9.A substring s[l…r] of s is a string slsl+1sl+2…sr. A substring s[l…r] of s is called even if the number represented...原创 2019-03-22 11:46:36 · 483 阅读 · 0 评论 -
1139B B.Chocolates
You went to the store, selling n types of chocolates. There are ai chocolates of type i in stock.You have unlimited amount of cash (so you are not restricted by any prices) and want to buy as many ch...原创 2019-03-22 21:33:23 · 222 阅读 · 2 评论 -
1139C C. Edgy Trees
You are given a tree (a connected undirected graph without cycles) of n vertices. Each of the n−1 edges of the tree is colored in either black or red.You are also given an integer k. Consider sequenc...原创 2019-03-22 21:58:05 · 840 阅读 · 0 评论 -
1144B B. Parity Alternated Deletions
Polycarp has an array a consisting of n integers.He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element and deletes it (after the first ...原创 2019-04-03 21:31:09 · 208 阅读 · 0 评论 -
1144C C. Two Shuffled Sequences(优先队列和set的应用)
Two integer sequences existed initially — one of them was strictly increasing, and the other one — strictly decreasing.Strictly increasing sequence is a sequence of integers [x1<x2<⋯<xk]. An...原创 2019-04-03 21:45:34 · 238 阅读 · 0 评论 -
1140A A. Detective Book
Ivan recently bought a detective book. The book is so interesting that each page of this book introduces some sort of a mystery, which will be explained later. The i-th page contains some mystery that...原创 2019-03-23 11:34:36 · 273 阅读 · 0 评论 -
1140B B. Good String
You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the...原创 2019-03-23 11:52:16 · 345 阅读 · 0 评论 -
1144A A. Diverse Strings(set的应用)
A string is called diverse if it contains consecutive (adjacent) letters of the Latin alphabet and each letter occurs exactly once. For example, the following strings are diverse: “fced”, “xyz”, “r” a...原创 2019-04-01 23:15:13 · 338 阅读 · 0 评论 -
1145A A. Thanos Sort(暴力枚举)
Thanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap your fingers* to remove the first or the second half of the items, and repeat the process.Giv...原创 2019-04-02 22:01:31 · 233 阅读 · 0 评论 -
1153A A. Serval and Bus
It is raining heavily. But this is the first day for Serval, who just became 3 years old, to go to the kindergarten. Unfortunately, he lives far from kindergarten, and his father is too busy to drive ...原创 2019-04-17 22:04:46 · 1553 阅读 · 0 评论 -
1154C C. Gourmet Cat(枚举)
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:on Mondays, Thursdays and Sundays he eats fish food;on Tuesdays and Saturdays he eats ra...原创 2019-04-18 20:49:13 · 270 阅读 · 0 评论 -
1152A A. Neko Finds Grapes
On a random day, Neko found n treasure chests and m keys. The i-th chest has an integer ai written on it and the j-th key has an integer bj on it. Neko knows those chests contain the powerful mysterio...原创 2019-04-25 10:30:46 · 384 阅读 · 0 评论 -
cf1191 B. Tokitsukaze and Mahjong
Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and...原创 2019-07-14 09:53:34 · 336 阅读 · 0 评论 -
cf1191 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-07-14 10:06:56 · 244 阅读 · 0 评论 -
cf1197A A. DIY Wooden Ladder
Let’s denote a k-step ladder as the following structure: exactly k+2 wooden planks, of whichtwo planks of length at least k+1 — the base of the ladder;k planks of length at least 1 — the steps of th...原创 2019-07-23 21:42:08 · 194 阅读 · 0 评论 -
cf1197B B. Pillars
B. Pillarstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n pillars aligned in a row and numbered from 1 to n.Initially each pil...原创 2019-07-23 21:47:46 · 234 阅读 · 0 评论 -
cf1214C C. Bad Sequence
C. Bad Sequencetime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputPetya’s friends made him a birthday present — a bracket sequence. Petya was qui...原创 2019-09-05 09:35:07 · 590 阅读 · 0 评论