LightOJ - 1370】的更多相关文章

A - Bi-shoe and Phi-shoe Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1370 Appoint description:  System Crawler  (2016-07-08) Description Bamboo Pole-vault is a massively popular sport in X…
http://lightoj.com/volume_showproblem.php?problem=1370 Bi-shoe and Phi-shoe Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1370 Description Bamboo Pole-vault is a massively popular sport in X…
/* LightOJ 1370 Bi-shoe and Phi-shoe http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1370 数论 欧拉函数 坑点是答案会爆int!!!! */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <vector…
题目链接: http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1370 题意: 给定值,求满足欧拉值大于等于这个数的最小的数. 分析: 两个质数之间的合数的欧拉值小于较小的质数,所以满足比给定的值大的欧拉值肯定是大于这个数的第一个质数. 二分查找一下就好了. 代码: #include <iostream> #include<cstdio> #include<algorithm> #i…
1370 - Bi-shoe and Phi-shoe   PDF (English) Statistics   Time Limit: 2 second(s) Memory Limit: 32 MB Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for hi…
分析:对于每个数,找到欧拉函数值大于它的,且标号最小的,预处理欧拉函数,然后按值建线段树就可以了 #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include <cmath> #include <map> using namespace std; typedef long long LL; ; const int INF…
题目大意:f(x)=n 代表1-x中与x互质的数字的个数.给出n个数字a[i],要求f(x)=a[i],求x的和. 思路:每个素数x 有x-1个不大于x的互质数.则f(x)=a[i],若a[i]+1为素数则x=a[i]+1,否则a[i]++直到得到素数位置. #include<cstdio> #include<stdio.h> #include<cstdlib> #include<cmath> #include<iostream> #includ…
题意:题目给出一个欧拉函数值F(X),让我们求>=这个函数值的最小数N,使得F(N) >= F(X); 分析:这个题目有两种做法.第一种,暴力打出欧拉函数表,然后将它调整成有序的,再建立一个新的表格记录满足条件的最小的欧拉值. 第二种,根据欧拉函数的性质,针对一个素数N,F(N) = N-1; 然后假设第一个大于N的素数为M,它的函数值为M-1,这时,在(N,M)之间的任何一个数都是合数,并且他们的欧拉值一定小于M-1,所以我们要找到题目中要求的最小数,可以从比它大一的数开始找,直到找到第一个…
题目链接: https://vjudge.net/problem/LightOJ-1370 题目描述: 给出一些数字,对于每个数字找到一个欧拉函数值大于等于这个数的数,求找到的所有数的最小和. 知识点: 欧拉函数:https://baike.baidu.com/item/%E6%AC%A7%E6%8B%89%E5%87%BD%E6%95%B0/1944850?fr=aladdin /* * x的欧拉函数值:小于x且与x互质的数的个数 * 性质:素数p的欧拉函数值为p-1; */ #include…
Bi-shoe and Phi-shoe Time Limit: 2000MS   Memory Limit: 32768KB   64bit IO Format: %lld & %llu Submit Status Description Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs…