- 博客(6)
- 收藏
- 关注
原创 codeforces 1399D
题意描述You are given a binary string s consisting of n zeros and ones.Your task is to divide the given string into the minimum number of subsequences in such a way that each character of the string belongs to exactly one subsequence and each subsequence loo
2020-08-07 08:37:45 253
原创 codeforces1322A(括号匹配)
题意描述A bracketed sequence is called correct (regular) if by inserting “+” and “1” you can get a well-formed mathematical expression from it. For example, sequences “(())()”, “()” and “(()(()))” are correct, while “)(”, “(()” and “(()))(” are not.The teach
2020-08-03 20:51:39 182
原创 codeforces 1040B(思维)
题意描述有n个煎饼,每次可以反转会反转左右k个,求最小反转次数思路如果k为0的话,每个煎饼一定需要反转。如果nnn能够整除2∗k+12*k+12∗k+1的话,那么每次都加2∗k+12*k+12∗k+1一定不会重叠,否则的话,我们可以先对余数的情况进行输出,然后就转换成了整除的状态。AC代码#include<bits/stdc++.h>#define x first#define y second#define PB push_back#define mst(x,a) memse
2020-08-02 21:14:11 161
原创 codeforces 1005D(数学)
题意描述给定一个字符串s,询问有s最多能够分成几部分可以被3整除思路我们发现,如果连续三位的数都不能被3整除,那么这三位加起来一定可以被整除。所以我们遍历一遍即可。AC代码#include<bits/stdc++.h>#define x first#define y second#define PB push_back#define mst(x,a) memset(x,a,sizeof(x))#define all(a) begin(a),end(a)#define rep
2020-08-02 13:46:36 201
原创 codeforces 1364B(数学)
题意描述Given a permutation p of length n, find its subsequence s1, s2, …, sk of length at least 2 such that:|s1−s2|+|s2−s3|+…+|sk−1−sk| is as big as possible over all subsequences of p with length at least 2.Among all such subsequences, choose the one whos
2020-08-01 16:41:16 225
原创 codeforces 1366B(线段相交)
题意描述You are given an array consisting of n integers a1, a2, …, an. Initially ax=1, all other elements are equal to 0.You have to perform m operations. During the i-th operation, you choose two indices c and d such that li≤c,d≤ri, and swap ac and ad.Calc
2020-08-01 15:13:30 164
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人