码迷,mamicode.com
首页 >  
搜索关键字:nearly prime numbers    ( 9679个结果
leetcode1 twoSum
1 """ 2 Given an array of integers, return indices of the two numbers such that they add up to a specific target. 3 4 You may assume that each input w ...
分类:其他好文   时间:2020-02-01 23:27:36    阅读次数:86
筛法求素数模板1
基础知识,没什么好说的,直接上代码! 1 const int maxn = 1e8; 2 int prime[maxn+5]; 3 int len; 4 5 int initial_prime() 6 { 7 memset(prime,0,sizeof(prime)); 8 prime[0]=pri ...
分类:其他好文   时间:2020-02-01 23:09:18    阅读次数:63
题解 CF446C 【DZY Loves Fibonacci Numbers】
# 题解 CF446C这是一道数据结构题。 我们先翻译下题目: 给你一个n,给你一个长度为n的序列,给你一个m,给你m此操作,包括区间修改和查询,修改为在一个区间内每个数加上他所对应的斐波那契数,查询为查询区间和。 一看到区间修改和区间查询,我们就可以知道这是一道线段树的题目(不要问我怎么知道的,~ ...
分类:其他好文   时间:2020-02-01 16:21:14    阅读次数:80
LeetCode 479 - Largest Palindrome Product - Hard ( Python)
Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro ...
分类:编程语言   时间:2020-02-01 10:47:36    阅读次数:78
筛质数
1 #include <iostream> 2 using namespace std; 3 4 const int N = 1e6+10; 5 6 int cnt; 7 int flag[N], prim[N]; 8 //埃式筛法 O(nlog(log(n))) 9 void get_prime( ...
分类:其他好文   时间:2020-02-01 00:57:16    阅读次数:100
【模板】【数学】线性筛求莫比乌斯函数
void init(){ //莫比乌斯函数线性筛 memset( prime , 0 , sizeof(prime) ); memset( mu , 0 , sizeof(mu) ); memset( vis , 0 , sizeof(vis) ); mu[1] = 1 ; cnt = 0 ; fo ...
分类:其他好文   时间:2020-01-31 15:51:26    阅读次数:76
LeetCode | No.1 两数之和
题目描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would h ...
分类:其他好文   时间:2020-01-31 12:38:32    阅读次数:93
adb 无线连接手机设备
连接语法: $ adb connect ip:port 断开连接: $ adb disconnect ip:port 可能遇到问题:unable to connect to 192.168.199.248:5555: Connection refused 解决办法(设置监听端口): su 切换roo ...
分类:移动开发   时间:2020-01-30 19:19:40    阅读次数:197
PAT甲级——1073 Scientific Notation (20分)
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+ ...
分类:其他好文   时间:2020-01-30 18:59:25    阅读次数:58
试除法判断质数
复杂度 根号n 1 bool is_prime(int a){ 2 if(a < 2) return false; 3 for(int i = 2;i <= a/i;++i) 4 if(a % i == 0) return false; 5 return true; 6 } View Code ...
分类:其他好文   时间:2020-01-30 17:25:54    阅读次数:119
9679条   上一页 1 ... 49 50 51 52 53 ... 968 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!