1.守护进程:主进程代码结束,守护进程立马结束 #守护进程 daemon:print('主')执行完成后,p1就结束掉 from multiprocessing import Process import time #并发,在同一个终端打印 def work(): print("123" ) tim ...
分类:
编程语言 时间:
2020-03-28 21:33:53
阅读次数:
73
本题要求实现一个判断素数的简单函数、以及利用该函数计算给定区间内素数和的函数。 素数就是只能被1和自身整除的正整数。注意:1不是素数,2是素数。 函数接口定义: int prime( int p ); int PrimeSum( int m, int n ); 其中函数prime当用户传入参数p为素 ...
分类:
其他好文 时间:
2020-03-28 19:58:43
阅读次数:
167
LeetCode 0070. Climbing Stairs爬楼梯【Easy】【Python】【动态规划】 Problem "LeetCode" You are climbing a stair case. It takes n steps to reach to the top. Each tim ...
分类:
编程语言 时间:
2020-03-27 21:32:23
阅读次数:
84
Message Decoding, ACM/ICPC World Finals 1991,UVa 213 ...
分类:
其他好文 时间:
2020-03-27 17:15:43
阅读次数:
88
UVA 12304 2D Geometry 110 in 1! 该问题包含以下几个子问题 1. CircumscribedCircle x1 y1 x2 y2 x3 y3 : 三角形外接圆 2. InscribedCircle x1 y1 x2 y2 x3 y3: 三角形内接圆 3. Tangent ...
分类:
其他好文 时间:
2020-03-26 01:43:33
阅读次数:
297
题目大意:将范围从1~pow(2,64)-1内的super power输出。super power的定义:一个数x至少存在两种x=pow(i,k),(k!=1)。 题解: 注意数据范围2的64次方-1,而long long 的范围是2的63次方-1,所以要用unsigned long long。 一 ...
分类:
其他好文 时间:
2020-03-22 19:43:28
阅读次数:
68
"L1 006 连续因子 (20分)" 一个正整数 $N$ 的因子中可能存在若干连续的数字。例如 $630$ 可以分解为 $3×5×6×7$,其中 $5,6,7$ 就是 $3$ 个连续的数字。给定任一正整数 $N$,要求编写程序求出最长连续因子的个数,并输出最小的连续因子序列。 输入格式: 输入在一 ...
分类:
其他好文 时间:
2020-03-22 14:13:43
阅读次数:
50
1. 如果不声明命名空间,每次使用 cin, cout, endl 时,就需要加上域算符 ::,比如 std::cin >> i; std::cout << i << std::endl; 2. 可以在代码前面加上 using 声明,比如 using std::cin; using std::cou ...
分类:
编程语言 时间:
2020-03-21 20:56:10
阅读次数:
78
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Input: n = 10 Outpu ...
分类:
其他好文 时间:
2020-03-21 19:41:35
阅读次数:
75
1 #include <iostream> 2 #define black 'f' 3 #define white 'e' 4 #define grey 'p' 5 using namespace std; 6 struct node{ 7 char type; 8 node* upper_r; 9 ...
分类:
其他好文 时间:
2020-03-21 16:25:21
阅读次数:
64