任意门:http://codeforces.com/contest/1118/problem/D1 D1. Coffee and Coursework (Easy version) time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The only difference between easy and hard versions…
D1. RGB Substring (easy version) time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The only difference between easy and hard versions is the size of the input. You are given a string s consistin…
D. Roman Digits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers…
Div1A / 2C. Make Nonzero Sum 令最后每个\(a_i\)的系数为\(c_i\)(\(c_i=1/-1\)),发现只要满足\(c_1=1\)(下标从1开始),且c中没有两个-1相连,就一定能找出一种划分方式.那我们先令所有\(c_i\)都为1,再进一步把一些1改成-1.如果全是1时序列的和sum已经是0,那么就已经找到一个答案了.否则我们只会把\(a_i=1/-1\)的位置的系数改成-1,当\(sum>0\)时改\(a_i=1\)的i的系数,否则改\(a_i=-1\)的i…