codeforces上分记录
不拿牌不改名
ACM刚入门,博客写错了可以留言给我啊
展开
-
构造思维 Codeforces Round #644 (Div. 3) F. Spy-string
F. Spy-stringYou are given n strings a1,a2,…,an: all of them have the same length m. The strings consist of lowercase English letters.Find any string s of length m such that each of the given n strings differs from s in at most one position. Formally, fo原创 2020-05-25 13:14:49 · 166 阅读 · 0 评论 -
位运算+思维 Codeforces Round #630 (Div. 2) D题 Walk on Matrix
Walk on Matrix题目大意为:给你一个正整数 k ,让你设计一个n*m棋盘,棋盘的每个点都有一个值,刚开始你在(1,1)点,你的目标是走到(n,m)点,并且要得到最大权值,权值计算式子为dp[i][j]=max(dp[i-1][j]&a[i][j],dp[i][j-1]&a[i][j]);显然这种dp只适用于常规运算,位运算不适用;所以题目给你k,让你设计棋盘,让...原创 2020-04-01 15:41:37 · 246 阅读 · 0 评论 -
思维+模拟 Codeforces Round #629 (Div. 3) D题 Carousel
CarouselThe round carousel consists of n figures of animals. Figures are numbered from 1 to n in order of the carousel moving. Thus, after the n-th figure the figure with the number 1 follows. Each f...原创 2020-03-27 11:49:38 · 504 阅读 · 0 评论 -
Codeforces Round #625 (Div. 2, based on Technocup 2020 Final Round) D题
Navigation SystemThe map of Bertown can be represented as a set of n intersections, numbered from 1 to n and connected by m one-way roads. It is possible to move along the roads from any intersection...原创 2020-03-02 17:38:07 · 341 阅读 · 0 评论 -
Codeforces Round #625 (Div. 2, based on Technocup 2020 Final Round) C题
Remove AdjacentYou are given a string s consisting of lowercase Latin letters. Let the length of s be |s|. You may perform several operations on this string.In one operation, you can choose some ind...原创 2020-03-02 12:48:40 · 147 阅读 · 0 评论 -
线性dp+单调栈 Codeforces Round #622 (Div. 2) C Skyscrapers
Skyscrapers (hard version)This is a harder version of the problem. In this version n≤500000The outskirts of the capital are being actively built up in Berland. The company “Kernel Panic” manages the...原创 2020-02-24 21:42:41 · 228 阅读 · 0 评论 -
Educational Codeforces Round 82 (Rated for Div. 2) D题
Fill The BagYou have a bag of size n. Also you have m boxes. The size of i-th box is ai, where each ai is an integer non-negative power of two.You can divide boxes into two parts of equal size. Your...原创 2020-02-14 22:51:04 · 156 阅读 · 0 评论 -
Codeforces Round #619 (Div. 2) C题
Ayoub’s functionAyoub thinks that he is a very smart person, so he created a function f(s), where s is a binary string (a string which contains only symbols “0” and “1”). The function f(s) is equal ...原创 2020-02-14 21:02:36 · 352 阅读 · 0 评论 -
Educational Codeforces Round 72 (Rated for Div. 2) C题
The Number Of Good SubstringsYou are given a binary string s (recall that a string is binary if each character is either 0 or 1).Let f(t) be the decimal representation of integer t written in binary...原创 2020-02-10 20:47:58 · 180 阅读 · 0 评论 -
Codeforces Round #618 (Div. 2) C题
Anu Has a FunctionAnu has created her own function f: f(x,y)=(x|y)−y where | denotes the bitwise OR operation. For example, f(11,6)=(11|6)−6=15−6=9. It can be proved that for any nonnegative numbers ...原创 2020-02-10 11:48:53 · 133 阅读 · 0 评论 -
Educational Codeforces Round 81 (Rated for Div. 2) B题
Infinite PrefixesYou are given string s of length n consisting of 0-s and 1-s. You build an infinite string t as a concatenation of an infinite number of strings s, or t=ssss… For example, if s= 1001...原创 2020-01-30 21:47:52 · 521 阅读 · 0 评论 -
Educational Codeforces Round 80 (Rated for Div. 2) C题
Two ArraysYou are given two integers n and m. Calculate the number of pairs of arrays (a,b) such that:the length of both arrays is equal to m;each element of each array is an integer between 1 and ...原创 2020-01-15 13:11:34 · 276 阅读 · 0 评论 -
Hello 2020 C题
New Year and PermutationRecall that the permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permu...原创 2020-01-06 22:56:19 · 407 阅读 · 0 评论 -
Codeforces Round #611 (Div. 3) C题
Friends and GiftsThere are n friends who want to give gifts for the New Year to each other. Each friend should give exactly one gift and receive exactly one gift. The friend cannot give the gift to h...原创 2019-12-29 14:26:45 · 590 阅读 · 1 评论 -
Codeforces Round #610 (Div. 2) B题
K for the Price of One (Hard Version)This is the hard version of this problem. The only difference is the constraint on k — the number of gifts in the offer. In this version: 2≤k≤n.Vasya came to the...原创 2019-12-25 15:46:37 · 415 阅读 · 0 评论 -
Codeforces Round #609 (Div. 2) C题
Long Beautiful IntegerYou are given an integer x of n digits a1,a2,…,an, which make up its decimal notation in order from left to right.Also, you are given a positive integer k<n.Let’s call inte...原创 2019-12-22 11:24:04 · 173 阅读 · 0 评论 -
Educational Codeforces Round 78 (Rated for Div. 2) C题
Berry JamKarlsson has recently discovered a huge stock of berry jam jars in the basement of the house. More specifically, there were 2n jars of strawberry and blueberry jam.All the 2n jars are arran...原创 2019-12-20 14:49:50 · 356 阅读 · 0 评论 -
Codeforces Global Round 6 C题
Diverse MatrixLet a be a matrix of size r×c containing positive integers, not necessarily distinct. Rows of the matrix are numbered from 1 to r, columns are numbered from 1 to c. We can construct an ...原创 2019-12-18 09:22:23 · 186 阅读 · 0 评论 -
Codeforces Round #605 (Div. 3) (D题)
Remove One ElementYou 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.Your task is to calculate the...原创 2019-12-13 16:24:06 · 213 阅读 · 0 评论 -
Codeforces Round #604 (Div. 2) D题
Beautiful SequenceAn integer sequence is called beautiful if the difference between any two consecutive numbers is equal to 1. More formally, a sequence s1,s2,…,sn is beautiful if |si−si+1|=1 for all...原创 2019-12-06 17:44:14 · 135 阅读 · 0 评论 -
Codeforces Round #604 (Div. 2) B题
Beautiful NumbersYou are given a permutation p=[p1,p2,…,pn] of integers from 1 to n. Let’s call the number m (1≤m≤n) beautiful, if there exists two indices l,r (1≤l≤r≤n), such that the numbers [pl,pl...原创 2019-12-06 15:07:47 · 480 阅读 · 0 评论 -
Codeforces Round #603 (Div. 2) A/B/C/D
A. Sweet Problem题意为给你三堆糖果,让你每天吃两个,两个要不同,最多吃几天?这题貌似是到小学奥数题,先把最少的一堆糖果找到,然后尽量用它把其他两堆糖果补成相等的,然后再把剩余的糖果除余2分别加到两堆糖果里,输出最小的一堆;代码:#include<bits/stdc++.h>#define LL long long#define pa pair<int,...原创 2019-11-30 16:47:10 · 218 阅读 · 0 评论 -
Educational Codeforces Round 77 (Rated for Div. 2) C题
C. Infinite FenceYou are a rebel leader and you are planning to start a revolution in your country. But the evil Government found out about your plans and set your punishment in the form of correctio...原创 2019-11-28 23:24:22 · 351 阅读 · 0 评论 -
Codeforces Round #601 (Div. 2) C题
League of LeesinsBob is an avid fan of the video game “League of Leesins”, and today he celebrates as the League of Leesins World Championship comes to an end!The tournament consisted of n (n≥5) tea...原创 2019-11-20 22:26:08 · 161 阅读 · 0 评论 -
Codeforces Round #601 (Div. 2) B题
Fridge LockersHanh lives in a shared apartment. There are n people (including Hanh) living there, each has a private fridge.n fridges are secured by several steel chains. Each steel chain connects t...原创 2019-11-20 16:18:17 · 256 阅读 · 0 评论 -
Codeforces Round #600 (Div. 2) D题
Harmonious GraphYou’re given an undirected graph with n nodes and m edges. Nodes are numbered from 1 to n.The graph is considered harmonious if and only if the following property holds:For every tr...原创 2019-11-17 15:59:41 · 215 阅读 · 0 评论 -
Educational Codeforces Round 76 (Rated for Div. 2) C题
C. Dominated SubarrayLet’s call an array t dominated by value v in the next situation.At first, array t should have at least 2 elements. Now, let’s calculate number of occurrences of each number num...原创 2019-11-14 20:18:31 · 200 阅读 · 1 评论 -
Educational Codeforces Round 76 (Rated for Div. 2) D题
D. Yet Another Monster Killing ProblemYou play a computer game. In this game, you lead a party of m heroes, and you have to clear a dungeon with n monsters. Each monster is characterized by its power...原创 2019-11-15 16:46:59 · 272 阅读 · 0 评论 -
Codeforces Round #598 (Div. 3) C题
Codeforces Round #598 (Div. 3)There is a river of width n. The left bank of the river is cell 0 and the right bank is cell n+1 (more formally, the river can be represented as a sequence of n+2 cells ...原创 2019-11-05 15:49:02 · 255 阅读 · 0 评论 -
Codeforces Round #598 (Div. 3) D题
Binary String MinimizingYou are given a binary string of length n (i. e. a string consisting of n characters ‘0’ and ‘1’).In one move you can swap two adjacent characters of the string. What is the ...原创 2019-11-05 11:52:22 · 236 阅读 · 0 评论 -
Codeforces Round #597 (Div. 2) D题
Shichikuji and Power GridShichikuji is the new resident deity of the South Black Snail Temple. Her first job is as follows:There are n new cities located in Prefecture X. Cities are numbered from 1 ...原创 2019-11-02 15:29:07 · 230 阅读 · 0 评论 -
Codeforces Round #597 (Div. 2) C题
C. Constanze’s MachineConstanze is the smartest girl in her village but she has bad eyesight.One day, she was able to invent an incredible machine! When you pronounce letters, the machine will inscr...原创 2019-11-02 10:46:46 · 232 阅读 · 0 评论 -
Codeforces Round #596 (Div. 2, based on Technocup 2020 Elimination Round 2) C题
p-binaryVasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a single integer p (which may be positive, negative, or zer...原创 2019-10-27 16:44:26 · 1788 阅读 · 0 评论 -
Codeforces Round #596 (Div. 2, based on Technocup 2020 Elimination Round 2) B2
B2 - TV Subscriptions (Hard Version)The only difference between easy and hard versions is constraints.The BerTV channel every day broadcasts one episode of one of the k TV shows. You know the schedu...原创 2019-10-27 13:25:49 · 217 阅读 · 0 评论 -
思维+模拟 Educational Codeforces Round 75 (Rated for Div. 2) C题
C. Minimize The IntegerYou are given a huge integer a consisting of n digits (n is between 1 and 3⋅105, inclusive). It may contain leading zeros.You can swap two digits on adjacent (neighboring) pos...原创 2019-10-25 16:06:05 · 191 阅读 · 0 评论 -
Educational Codeforces Round 75 (Rated for Div. 2) B题
B. Binary Palindromestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA palindrome is a string t which reads the same backward as forward (for...原创 2019-10-25 16:00:46 · 137 阅读 · 0 评论 -
Codeforces Round #595 (Div. 3) D题
Too Many Segments (hard version)The only difference between easy and hard versions is constraints.You are given n segments on the coordinate axis OX. Segments can intersect, lie inside each other an...原创 2019-10-23 22:45:50 · 351 阅读 · 0 评论 -
Codeforces Round #592 (Div. 2) D题
Paint the TreeYou are given a tree consisting of n vertices. A tree is an undirected connected acyclic graph.You have to paint each vertex into one of three colors. For each vertex, you know the cos...原创 2019-10-14 19:03:43 · 178 阅读 · 0 评论