Codeforces Round #272 (Div. 2)】的更多相关文章

Codeforces Round #272 (Div. 2) 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 at each move.…
题目链接 这个题取模的时候挺坑的!!! 题意:div(x , b) / mod(x , b) = k( 1 <= k <= a).求x的和 分析: 我们知道mod(x % b)的取值范围为 1  - (b-1).那么我们可以从这一点入口来进行解题.. mod (x, b) = 1 时, x  =  b + 1, 2b + 1, 3b + 1..... a * b + 1. mod (x , b) = 2 时, x =  2b + 2, 4b + 2, 6b + 2, ..... 2a * b…
A. Dreamoon and Stairs 题意:给出n层楼梯,m,一次能够上1层或者2层楼梯,问在所有的上楼需要的步数中是否存在m的倍数 找出范围,即为最大步数为n(一次上一级),最小步数为n/2+n%2 在这个范围里找即可 #include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<algorithm> using namespace std…
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 at each move. Dreamoon wants the number of mo…
http://www.codeforces.com/contest/477/problem/C 题目大意:给你n个集合,每个集合里面有四个数字,他们的gcd是k,输出符合条件的集合中m,m为集合中最大的数,且保证m要尽量小. 思路:由找规律可以得到集合的关系为1+6*k  2+6*k  3+6*k  5+6*k. 不过我的写法不是这样...(道理还是一样的) //看看会不会爆int!数组会不会少了一维! //取物问题一定要小心先手胜利的条件 #include <bits/stdc++.h> u…
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…
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…
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…
题目链接: 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…