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

题目:http://codeforces.com/contest/397/problem/B 题意:给一个n ,求能不能在[l, r]的区间内的数字相加得到, 数字可多次重复.. 比赛的时候没有想出来,看见这么大的数应该知道是思维题,比赛的时候还想会不会是背包什么的 其实数据有10^9,逗了.... k*[l, r]的范围是[k*l, k*r]; 所以只需要求n是不是在 [k*l , k*r]的范围内就行了 代码: #include <iostream> #include <cstdio…
这次运气比较好,做出两题.本来是冲着第3题可以cdq分治做的,却没想出来,明天再想好了. A. On Number of Decompositions into Multipliers 题意:n个数a1,a2, a3...an求n个数相乘与a1*a2*a3*a4...an相等的排列个数. 分析:首先应该对ai分解质因数,求出所有ai中质因数及个数,枚举排列中每个数包含的质因数个数,例如质因数qi,有ni个,相应的排列中数包含质因数qi个数设为x1,x2,....xn, x1+x2+x3..+xn…
A. On Number of Decompositions into Multipliers 题目连接:http://codeforces.com/contest/396/problem/A 大意:给定n(n<=500)个数ai(1<=ai<=10^9),得到他们的乘积m,问将m分解成n个数相乘,有多少种方法. 思路:显然每个质因数都是独立的,如果质因数pi出现了ci次,那么把它分到n个数中,就有C(ci+n-1,n-1)种方法,然后把所有因数的答案相乘就是结果.于是我们可以先预处理出…
D. On Sum of Fractions Let's assume that v(n) is the largest prime number, that does not exceed n; u(n) is the smallest prime number strictly greater than n. Find . Input The first line contains integer t (1 ≤ t ≤ 500) — the number of testscases. Eac…
Let's assume that v(n) is the largest prime number, that does not exceed n; u(n) is the smallest prime number strictly greater than n. Find . Input The first line contains integer t (1 ≤ t ≤ 500) — the number of testscases. Each of the following t li…
C. On Number of Decompositions into Multipliers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an integer m as a product of integers a1, a2, ... an . Your task is to find the…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…