码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
查找素数
#include<iostream>using namespace std;int main() { int i, j; bool isprime; for (i = 1; i <= 100; i++) { isprime = true; //see if the number is evenly ...
分类:其他好文   时间:2019-12-22 12:44:49    阅读次数:56
k Sum
Description Description Given n distinct positive integers, integer k (k <= n) and a number target. Find k numbers where sum is target. Calculate how ...
分类:其他好文   时间:2019-12-21 22:15:15    阅读次数:74
最小生成树
最小生成树:如果无向连通图是一个网,它的所有生成树中必有一棵边的权值总和最小的生成树,称这棵生成树为最小生成树。 Prime算法 假设G=(V,E)为一网图,其中V为网图中所有顶点的集合,E为网图中所有带权边的集合。设置两个新集合U和T,其中集合U用于存放G的最小生成树中的顶点,集合T存放G的最小生 ...
分类:其他好文   时间:2019-12-20 20:38:25    阅读次数:97
N!(hdu1042)
N! Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For each N, output N! i ...
分类:其他好文   时间:2019-12-16 22:12:08    阅读次数:118
C++ Primer (一)
Google C++ Style Guide 书籍:C++ Primer,C++标准程序库,Effective C++,C++ concurrency in Action, Linux多线程服务端编程 读取数量不定的输入数据 while内返回其左侧运算符,即std:cin, 当istream作为条件 ...
分类:编程语言   时间:2019-12-13 22:06:55    阅读次数:113
小练手2
1. """ Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters. Suppose the following input is s ...
分类:其他好文   时间:2019-12-13 18:04:44    阅读次数:122
PAT1059Prime Factors
1059 Prime Factors (25分) Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p?1???k?1?? ...
分类:其他好文   时间:2019-12-13 12:14:02    阅读次数:83
LeetCode试炼之路之(3):数据流中的移动平均值(346)
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example, MovingAverage m = new M ...
分类:移动开发   时间:2019-12-12 14:56:35    阅读次数:127
欧拉筛法(线性筛)素数
#include<bits/stdc++.h> using namespace std; #define maxn 40 int prime[maxn]; int visit[maxn]; void Prime(){//埃氏筛法 memset(visit,0,sizeof(visit)); //初始 ...
分类:其他好文   时间:2019-12-07 14:48:28    阅读次数:102
#4613. problem C
题目描述 给一棵 $n$ 个点的树,每条边的边权为 $1$ 。 强制在线。 有 $m$ 次询问,每次询问给出 $u^{\prime}, v^{\prime}, w^{\prime}$ ,令 $u=\left(u^{\prime}+\text {lastans}\right) \% n+1, v= \ ...
分类:其他好文   时间:2019-12-02 13:44:26    阅读次数:74
3428条   上一页 1 ... 20 21 22 23 24 ... 343 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!