题目链接:https://nanti.jisuanke.com/t/40515 题意:给你一个n,让你在圆上找n个点,最多能把圆分成多少个区域。 欧拉公式:R+V-E=2,其中的R,V,E分别是区域数,点数,边数 想分成最多的区域,只需要满足不会有3根线交于一个点就好。 尝试统计总的结点个数A(n) ...
分类:
其他好文 时间:
2019-08-08 21:05:53
阅读次数:
94
Description Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i and n. ...
分类:
其他好文 时间:
2019-08-08 12:54:14
阅读次数:
101
首先我们来百度一下,欧拉路径以及回路的定义: 若图G中存在这样一条路径,使得它恰通过G中每条边一次,则称该路径为欧拉路径。若该路径是一个圈,则称为欧拉(Euler)回路。 具有欧拉回路的图称为欧拉图(简称E图)。具有欧拉路径但不具有欧拉回路的图称为半欧拉图。 通俗来说,就是欧拉路径就是图中的每条边经 ...
分类:
其他好文 时间:
2019-08-07 22:53:29
阅读次数:
125
我们都知道欧拉筛又称线性筛,能在O(n)的时间复杂度内筛出n以内的所有质数,而我们只要在线性筛的代码上改良一下就能求出n以内所有数的欧拉函数了。筛质数时,设外层在枚举i,内层枚举到prime[j],这时有两种情况: 附上代码: ...
分类:
其他好文 时间:
2019-08-07 09:21:58
阅读次数:
198
集训1(HDU2018 Multi-University Training Contest 2)补题 E、G 较简单,赛后应马上补上。 C、F 属于常见知识点,也应尽快补上。 ...
分类:
编程语言 时间:
2019-08-06 23:58:39
阅读次数:
253
``` include using namespace std; typedef long long ll; const int N = 1e7+5; int p[N],oa[N]; bool vis[N]; int oula(int n) { memset(vis,0,sizeof(vis)); ...
分类:
其他好文 时间:
2019-08-03 21:45:05
阅读次数:
117
1 Java大数 2 import java.util.*; 3 import java.math.*; 4 public class Main{ 5 public static void main(String args[]){ 6 Scanner cin = new Scanner(System... ...
分类:
其他好文 时间:
2019-08-03 21:40:24
阅读次数:
95
题目链接:http://poj.org/problem?id=2513 Colored Sticks Time Limit: 5000MS Memory Limit: 128000K Total Submissions:40949 Accepted: 10611 Description You ar ...
分类:
其他好文 时间:
2019-08-03 21:16:57
阅读次数:
103
旋转计算旋转到目标向量朝向的欧拉角(四元数),不含Roll。/** * Return the FRotator orientation corresponding to the direction in which the vector points. * Sets Yaw and Pitch to... ...
分类:
其他好文 时间:
2019-08-03 21:10:26
阅读次数:
97