
思维题
文章平均质量分 75
胡先生啦
初学C语言,希望和大家共同进步。
展开
-
Codeforces Round #764
D题 : Division by Two and Permutation题意:首先我晚上写这道题的时候是没有读懂题意的/wu,后来听了别人的讲解才明白是咋回事。现在给出一个长度为n的字符串str和一个整数k。k代表的是有k种颜色,要求每种颜色必须要至少要在给出的字符串上涂一个字符。(其他字符可以不涂色)然后将所有颜色单独任意排列,每个颜色排列的字符串必须是回文串。现在让你求出k种颜色中的回文串最短的字符串的最大值。即 使最短的回文串尽量大。思路:首先统计出所有的对数,对所有字符除对数外的统计原创 2022-01-11 15:57:52 · 310 阅读 · 0 评论 -
C. Number of Pairs div3
C. Number of Pairstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a of n integers. Find the number of pairs (i,j) (1≤i<j≤n) where the sum of ai+aj is greater than or equal原创 2021-06-11 21:05:45 · 492 阅读 · 0 评论 -
背包问题
Baby Ehab Partitions AgainBaby Ehab was toying around with arrays. He has an array a of length n. He defines an array to be good if there’s no way to partition it into 2 subsequences such that the sum of the elements in the first is equal to the sum of th原创 2021-06-10 21:44:51 · 193 阅读 · 0 评论 -
cf思维题
一 Balance the Bits 传送门A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters ‘+’ and ‘1’. For example, sequences ‘(())()’, ‘()’, and ‘(()(()))’ are balanced, while ‘)(’, ‘(()’, and ‘(()))(’ a原创 2021-04-06 19:26:46 · 684 阅读 · 0 评论