D - ABC Transform
Given a string containing ABC, one character will become two characters for each extension. A →BC, B →CA, C →AB. Q times of inquiry, after ti times of expansion, what is the ki character? Q ≤10^5, ti<10^18, ki<min(1e18, the length of S(t))
For a higher number of layers, each time the path is found, it ...
Posted by inversesoft123 on Sun, 06 Mar 2022 16:32:42 +0100
Link Title: https://codeforces.com/contest/1525/problem/D
Main idea of the title:
0,1 sequence of numbers, a[i]=0 or 1. The number of 1 must not exceed half of n. We need to pair all 1s with a 0. A 0 can only be paired with a 1 ifandPairing will consumeResources. What is the minimum total resource consumption after all 1s are paired?
Posted by a.beam.reach on Sat, 12 Feb 2022 00:57:10 +0100
Codeforces Round #753 (Div.3) A~D problem solution
A. Linear Keyboard
meaning of the title
Given a keyboard composed of 26 lowercase letters in a certain order, each group gives a word, and calculates the distance that the hand moves to complete the word.
First, create two strings a and s to store the keyboard and words respective ...
Posted by willeadie on Fri, 04 Feb 2022 05:25:56 +0100
Blog home page: https://blog.csdn.net/qq_50285142Welcome to praise 👍 Collection ⭐ ， attention ❤ Leaving a message. 📝 Please correct any errors 🎈 Click to receive a large number of learning resources 🎈
A. Equidistant Letters
A string that requires equal distances between the same letters and rearranges them
Find the same letters, arr ...
Posted by mooshuligan on Sat, 22 Jan 2022 12:52:07 +0100
Consider all extremely long zeros, and discuss their length classification——
1. If its length is $2m+1 $, always pair the head / tail with adjacent non-0 elements, and the other elements into $M $pairs
At the same time, if the $k $corresponding to one element in the beginning and end has appeared, it must be paired with another elem ...
Posted by Hailwood on Fri, 14 Jan 2022 09:13:00 +0100
Codeforces div3-498 Problem solution
A. Adjacent Replacements
The problem is relatively simple. If the number N is an odd number, it will remain unchanged after transformation. If the number is an even number, it will become N - 1
const int maxn=1005;
Posted by Matt Phelps on Sun, 09 Jan 2022 13:30:10 +0100
Better reading experience: http://www.abmcar.top/archives/codeforceshello2022 Complete source code: https://github.com/abmcar/ACM/tree/master/OpenjudgeNow/Codeforces/Hello%202022 Tip from the front row: the questions in this field are very disgusting and are not recommended
A. Stable Arrangement of Rooks
Main idea of the topic: give you a bo ...
Posted by JackSevelle on Thu, 06 Jan 2022 15:20:18 +0100
Full code: https://github.com/abmcar/ACM/tree/master/OpenjudgeNow/Codeforces/Good%20Bye%202021-2022%20is%20NEAR
Better reading experience: http://www.abmcar.top/archives/goodbye20212022isneara-d-ti-jie
A. Integer Diversity
Give you n numbers, you can choose any number to multiply by - 1, and ask how many different numbers you can get at mos ...
Posted by Waire on Mon, 03 Jan 2022 06:03:52 +0100