Fox and Number Game Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description Fox Ciel is playing a game with numbers now. Ciel has n positive integers: x1, x2, ..., xn. She can do the following operation…
A. Co-prime Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an array of n elements, you must make it a co-prime array in as few moves as possible. In each move you can i…
A. Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your friend has recently learned about coprime numbers. A pair of numbers {a, b} is called coprime if the maximum number th…
C. Monitor time limit per test 0.5 second memory limit per test 64 megabytes input standard input output standard output Reca company makes monitors, the most popular of their models is AB999 with the screen size a × b centimeters. Because of some pr…
[codeforces 55]D. Beautiful numbers 试题描述 Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with this and…
题目链接:http://codeforces.com/problemset/problem/483/A 题目意思:给出一个区间 [l, r],要从中找出a, b, c,需要满足 a, b 互质,b, c 互质,但是 a, c 不互质,也就是除了 1 之后还有其他公约数.要求 1<= a < b < c <= r,也就是 a, b, c 两两不相等的.如果找不出则输出 -1. 首先很容易知道,如果 [l, r] 这个区间只有两个数,那么肯定没有答案.还有一种情况是,如果 [l, r]…
A - A Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 300C Description Vitaly is a very weird man. He's got two favorite digits a and b. Vitaly calls a positive integer good, if the deci…