1007 - Mathematically Hard PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 64 MB Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable. In this problem, you will be giv…
1007 - Mathematically Hard PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 64 MB Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable. In this problem, you will be giv…
预先处理好phi数组和前缀和,水题. #include<cstdio> #include<string> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int MAXN = 5e6+10; unsigned long long int phi[MAXN]; void init(){ for(int i = 1;i < M…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1007 题意:给你两个数a和b,求他们之间所有数的欧拉值得平方和; a and b (2 ≤ a ≤ b ≤ 5 * 106). 线性打表求值即可; 结果会爆long long,要用unsigned long long %llu形式; #include <stdio.h> #include <string.h> #include <algorithm> typ…
// Problem#: 1007// Submission#: 4893204// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic La…
Aladdin and the Flying Carpet Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1341 Appoint description: System Crawler (2016-07-08) Description It's said that Aladdin had to solve seven myst…
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…
Extended Traffic Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1074 Appoint description: System Crawler (2016-05-03) Description Dhaka city is getting crowded and noisy day by day. Certai…
Conquering Keokradong Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1048 Description This winter we are going on a trip to Bandorban. The main target is to climb up to the top of Keokradong.…
D - Harmonic Number Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1234 Description In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In th…
E - Help Hanzo Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1197 Description Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he ha…
B - Pairs Forming LCM Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1236 Description Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( in…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1220 题意:已知 x=bp 中的 x 求最大的 p,其中 x b p 都为整数 x = (p1a1*p2a2*p3a3*...*pkak), pi为素数;则结果就是gcd(a1, a2, a3,...,ak); 当x为负数时,要把ans缩小为奇数; #include <stdio.h> #include <string.h> #include <iostream&…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1215 题意:已知三个数a b c 的最小公倍数是 L ,现在告诉你 a b L 求最小的 c ; 其实就是告诉你(最小公倍数LCM)LCM(x, y) = L 已知 x 和 L 求 最小的 y ; L = LCM(x, y)=x*y/gcd(x, y);如果把x,y,L写成素因子之积的方式会很容易发现 L 就是 x 和 y 中素因子指数较大的那些数之积; 例如LCM(24, y)…