codeforces Nikita and string time limit per test 2 seconds memory limit per test 256 megabytes One day Nikita found the string containing letters "a" and "b" only. Nikita thinks that string is beautiful if it can be cut into 3 stri…
题目链接:Balanced Ternary String 题目大意:给一个字符串,这个字符串只由0,1,2构成,然后让替换字符,使得在替换字符次数最少的前提下,使新获得的字符串中0,1,2 这三个字符的数目相同,并且新获得的字符串的字典序要尽可能的小: 直接数组做法:暴力遍历 /* */ # include <bits/stdc++.h> using namespace std; typedef long long ll; int n; ]; string s; int main() { io…
L - One-Dimensional Maze Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3992 Description BaoBao is trapped in a one-dimensional maze consisting of \(n\) grids arranged in a row! The grids are num…
C - Crusaders Quest Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3983 Description Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world,…
题目描述 Iahub and Sorin are the best competitive programmers in their town. However, they can't both qualify to an important contest. The selection will be made with the help of a single problem. Blatnatalag, a friend of Iahub, managed to get hold of th…