随笔分类 -  数论。

1 2 下一页

51nod 1284
摘要:给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数。 例如N = 10,只有1不是2 3 5 7的倍数。 收起 输入 输入1个数N(1 <= N <= 10^18)。 输出 输出不是2 3 5 7的倍数的数共有多少。 输入样例 10 输出样例 1 思路 :容斥原理 如果被计数的事物有A、B 阅读全文

posted @ 2020-03-08 11:12 缄默。 阅读(92) 评论(0) 推荐(0) 编辑

HDU Ignatius and the Princess II 全排列下第K大数
摘要:#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>#include<iostream> using namespace std; #define ll long long#define N 110000int s[N 阅读全文

posted @ 2017-11-08 09:02 缄默。 阅读(168) 评论(0) 推荐(0) 编辑

HDU 1006 模拟
摘要:Tick and Tick Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20120 Accepted Submission(s): 5262 阅读全文

posted @ 2017-11-07 16:28 缄默。 阅读(108) 评论(0) 推荐(0) 编辑

快速傅里叶变换
摘要:http://blog.csdn.net/iamzky/article/details/22712347 http://blog.csdn.net/quack_quack/article/details/50620052 http://www.gatevin.moe/acm/fft算法学习笔记/ 阅读全文

posted @ 2017-11-07 11:01 缄默。 阅读(131) 评论(0) 推荐(0) 编辑

1336 - Sigma Functio
摘要:1336 - Sigma Function Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually 阅读全文

posted @ 2017-10-20 16:50 缄默。 阅读(188) 评论(0) 推荐(0) 编辑

1282 - Leading and Trailing 求n^k的前三位和后三位。
摘要:1282 - Leading and Trailing You are given two integers: n and k, your task is to find the most significant three digits, and least significant three d 阅读全文

posted @ 2017-10-20 11:13 缄默。 阅读(202) 评论(0) 推荐(0) 编辑

1236 - Pairs Forming LCM
摘要:1236 - Pairs Forming LCM Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for 阅读全文

posted @ 2017-10-17 17:21 缄默。 阅读(166) 评论(0) 推荐(0) 编辑

1215 - Finding LCM
摘要:1215 - Finding LCM LCM is an abbreviation used for Least Common Multiple in Mathematics. We say LCM (a, b, c) = L if and only if L is the least intege 阅读全文

posted @ 2017-10-13 15:51 缄默。 阅读(207) 评论(0) 推荐(0) 编辑

1213 - Fantasy of a Summation
摘要:1213 - Fantasy of a Summation If you think codes, eat codes then sometimes you may get stressed. In your dreams you may see huge codes, as I have seen 阅读全文

posted @ 2017-10-12 10:48 缄默。 阅读(144) 评论(0) 推荐(0) 编辑

1163 - Bank Robbery
摘要:1163 - Bank Robbery In one very cold morning, Mark decides to rob a bank. But while trying hacking into the security system, he found that it is locke 阅读全文

posted @ 2017-10-10 16:03 缄默。 阅读(199) 评论(0) 推荐(0) 编辑

1138 - Trailing Zeroes (III) 二分
摘要:1138 - Trailing Zeroes (III) You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As y 阅读全文

posted @ 2017-10-10 15:25 缄默。 阅读(123) 评论(0) 推荐(0) 编辑

light oj 1045 - Digits of Factorial K进制下N!的位数
摘要:1045 - Digits of Factorial Factorial of an integer is defined by the following function f(0) = 1 f(n) = f(n - 1) * n, if(n > 0) So, factorial of 5 is 阅读全文

posted @ 2017-08-01 09:34 缄默。 阅读(155) 评论(0) 推荐(0) 编辑

light oj 1035 - Intelligent Factorial Factorization 素因子分解
摘要:1035 - Intelligent Factorial Factorization Given an integer N, you have to prime factorize N! (factorial N). Input Input starts with an integer T (≤ 1 阅读全文

posted @ 2017-07-31 10:29 缄默。 阅读(151) 评论(0) 推荐(0) 编辑

light oj1028 - Trailing Zeroes (I)
摘要:1028 - Trailing Zeroes (I) We know what a base of a number is and what the properties are. For example, we use decimal number system, where the base i 阅读全文

posted @ 2017-07-29 10:25 缄默。 阅读(213) 评论(0) 推荐(0) 编辑

light oj 1014 - Ifter Party分解因子
摘要:1014 - Ifter Party I have an Ifter party at the 5th day of Ramadan for the contestants. For this reason I have invited C contestants and arranged P pi 阅读全文

posted @ 2017-07-24 15:45 缄默。 阅读(189) 评论(0) 推荐(0) 编辑

light oj1170 - Counting Perfect BST卡特兰数
摘要:1170 - Counting Perfect BST BST is the acronym for Binary Search Tree. A BST is a tree data structure with the following properties. i) Each BST conta 阅读全文

posted @ 2017-07-20 16:42 缄默。 阅读(139) 评论(0) 推荐(0) 编辑

lightoj 1140 - How Many Zeroes?数位dp
摘要:1140 - How Many Zeroes? Jimmy writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes w 阅读全文

posted @ 2017-07-19 15:47 缄默。 阅读(153) 评论(0) 推荐(0) 编辑

light oj 1102 - Problem Makes Problem组合数学(隔板法)
摘要:1102 - Problem Makes Problem As I am fond of making easier problems, I discovered a problem. Actually, the problem is 'how can you make n by adding k  阅读全文

posted @ 2017-07-17 10:53 缄默。 阅读(236) 评论(0) 推荐(0) 编辑

light oj 1095 - Arrange the Numbers排列组合(错排列)
摘要:1095 - Arrange the Numbers Consider this sequence {1, 2, 3 ... N}, as an initial sequence of first N natural numbers. You can rearrange this sequence 阅读全文

posted @ 2017-07-15 16:48 缄默。 阅读(235) 评论(0) 推荐(0) 编辑

1058 - Parallelogram Counting 计算几何
摘要:1058 - Parallelogram Counting There are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose ve 阅读全文

posted @ 2017-07-14 10:37 缄默。 阅读(143) 评论(0) 推荐(0) 编辑

1 2 下一页

导航

点击右上角即可分享
微信分享提示