题目描述: Malek Dance Club time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fu…
Malek Dance Club time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun nigh…
Educational Codeforces Round 78 (Rated for Div. 2) 1278B - 6 B. A and B  time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given two integers aa and bb. You can perform a sequence of…
<题目链接> 题目大意: 给定数字n,让你将其分成合数相加的形式,问你最多能够将其分成几个合数相加. 解题分析: 因为要将其分成合数相加的个数最多,所以自然是尽可能地将其分成尽可能小的合数相加的形式.通过找规律,我们能够发现,所有的偶数都能够分成4和6这两个合数的组合,而所有的奇数,在减去9这个最小的奇合数后,就会变成偶数,然后就是和普通偶数一样的处理方式. 普通偶数的处理方式就是,看他能够分成几个4,如果该偶数不为4的倍数,那么就是将其中的一个4换成6.总的最大合数个数为:$n/4$ 而奇数…
Ball Painting 题目连接: http://codeforces.com/gym/100015/attachments Description There are 2N white balls on a table in two rows, making a nice 2-by-N rectangle. Jon has a big paint bucket full of black paint. (Don't ask why.) He wants to paint all the b…
题目链接:http://codeforces.com/problemset/problem/603/A 题意: 给定一个 $01$ 串,我们“交替子序列”为这个串的一个不连续子序列,它满足任意的两个相邻的数字不相等. 现在,我们要对这个 $01$ 串的某一段非空连续子串进行反转操作,即将这一段上的所有 $0$ 变为 $1$,所有 $1$ 变为 $0$. 然后,求问进行了有且仅有一次的反转操作后,求该串的最长交替子序列的长度. 题解: 首先,对于一个 $01$ 串,对其进行压缩操作,即将所有连续的…
B. Lunch Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/B Description The swamp looks like a narrow lane with length n covered by floating leaves sized 1, numbered from 1 to n with a fly sitting on the top of ea…
D. Flowers time limit per test:1.5 seconds memory limit per test:256 megabytes We saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flo…
题目链接: http://codeforces.com/problemset/problem/353/D?mobile=true H. Queue time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 There are n schoolchildren, boys and girls, lined up in the school canteen in front of the bun stall. The b…
题目描述: Little Elephant and Interval time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant very much loves sums on intervals. This time he has a pair of integers l and r (l ≤ r…