petya专题

F - Petya and His Friends CodeForces - 66D(数论,素数构造)

Examples Input 3 Output 99 55 11115 Input 4 Output 385 360 792 8360 题意: 构造题,构造n个不相同的数,任意两个数gcd不等于1,所有数的gcd等于1. 思路: 个人认为这场最有想头的一道题目。最暴力的思路是打表搞出n个质数,第一个数除了第一个质数不选其他都选相乘,第二个数除了第二个数不选其他都选相乘。当然数据范围是承受不了的(

(判断数字类型)C - Petya and Java CodeForces - 66A

Input The first line contains a positive number n. It consists of no more than 100 digits and doesn’t contain any leading zeros. The number n can’t be represented as an empty string. Please, do not u

Vasya and Petya's Game CodeForces - 577C

http://codeforces.com/problemset/problem/577/C 问序列中最少含几个数 使得1-n的每一个数都能用序列中的几个数相乘得到 把每个数都素因子分解为(2^p1)*(3^p2)*(5^p3)...这种形式 把2^1...2^p1等都扔数组里去个重就好   #include <bits/stdc++.h>using namespace std;con

CF 61 div2 D. Petya and His Friends

题目:D - Petya and His Friends 思路:高精度模板可以过,但是找规律也行 高精度的: #include <cstdio>#include <iostream>#include <algorithm>#include <cmath>#include <cstring>#include <sstream>#include <map>using

Codeforces - 66D - Petya and His Friends(数论质数+思维)

题目: Little Petya has a birthday soon. Due this wonderful event, Petya's friends decided to give him sweets. The total number of Petya's friends equals to n. Let us remind you the definition of the g