文章分类 - Light OJ
1136 - Division by 3
摘要:题意:There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Now you are given two integers A and B, you have to find the number of integers from Ath number to Bth (inclusive) number, which are divisible by 3.For example, let A = 3. B = 5. So, the numbers in the sequence are, 123, 1234, 12345. And
阅读全文
1045 - Digits of Factorial(数论)
摘要:题意:给定n、k,求出n的阶乘转化为k进制一共有几位。思路:log(a*b)=log(a)+log(b)..............题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1045View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream>
阅读全文
1305 - Area of a Parallelogram
摘要:题意:给定平行四边形的3个顶点的坐标,求第四个点的坐标和平行四边形的面积。思路:几何基础题,不过用向量比较简单。题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1305View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 using na
阅读全文
1234 - Harmonic Number
摘要:题意:给定n,求1+1/2+1/3+....+1/n,1<=n<=10^8。思路:精度问题,欧拉常数:0.57721566490153286060651209 ,当n很大时就派上用场了- -!题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1234View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algori
阅读全文
浙公网安备 33010602011771号