B. Dreamoon and WiFi 题目连接: http://www.codeforces.com/contest/476/problem/B Description Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Eac…
http://codeforces.com/contest/476/problem/B B. Dreamoon and WiFi time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Dreamoon is standing at the position 0 on a number line. Drazil is sending a…
题目链接: http://www.codeforces.com/contest/476/problem/E E. Dreamoon and Strings time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining…
题意:给你一个只含\(+\)和\(-\)的字符串,统计它的加减和,然后再给你一个包含\(+,-,?\)的字符串,其中\(?\)可以表示为\(+\)或\(-\),问有多少种情况使得第二个字符串的加减和等于第一个. 题解:首先我们统计第一个字符串的和,然后统计第二个字符串的加减和以及\(?\)的个数,然后对于\(?\)我们进行二进制枚举,枚举它的所有可能情况的和,再加上第二个字符串的和每次判断一下是否和第一个相等即可. 代码: char s[N],t[N]; int main() { //ios::…
E. Dreamoon and Strings 题目连接: http://www.codeforces.com/contest/476/problem/E Description Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates that is defined…
D. Dreamoon and Sets 题目连接: http://www.codeforces.com/contest/476/problem/D Description Dreamoon likes to play with sets, integers and . is defined as the largest positive integer that divides both a and b. Let S be a set of exactly four distinct inte…
A. Dreamoon and Stairs 题目连接: http://www.codeforces.com/contest/476/problem/A Description Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps at each move. Dreamoon wants the number of moves to be a multiple of an integer m. What…
题目链接 Dreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if  and , where k is some integer number in range[1, a…
http://codeforces.com/contest/476/problem/C C. Dreamoon and Sums time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Dreamoon loves summing up something for no reason. One day he obtains two…
http://codeforces.com/contest/476/problem/A A. Dreamoon and Stairs time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps a…