
51nod(基础题)
dukig
尽人事,知天命。
展开
-
计算4个点是否共面
链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1265 把他们转化为行列式 #include<stdio.h> #include<string.h> int main() { int i,j,k,t,n,x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4,r1,r2,r...原创 2019-04-06 13:43:36 · 840 阅读 · 0 评论 -
乘法逆元(拓展欧几里得)
链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1256 #include<iostream> using namespace std; void egcd(long long a,long long b,long long &x,long long &y){ if(b == 0){ x ...原创 2019-04-06 14:56:08 · 475 阅读 · 0 评论 -
费波纳列数列第n项(矩阵快速幂)
链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1242 矩阵快速幂说白了就是用矩阵找规律+快速幂乘矩阵 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using names...原创 2019-04-06 16:37:37 · 450 阅读 · 0 评论 -
高精度威佐夫博弈
链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1185 本来威佐夫博弈只用a*(sqrt(5)+1)/2就行了,可这题精度太高,必须将0.618的精度再扩大很多倍 #include <iostream> #include <cstdio> #include <cstring> #inc...原创 2019-04-06 16:57:24 · 180 阅读 · 0 评论 -
n!的长度(斯特林公式)
链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1130 特林公式以及本题参考代码:https://blog.youkuaiyun.com/qq_41003528/article/details/82840908 #include<iostream> #include<algorithm> #include&l...原创 2019-04-07 15:49:19 · 528 阅读 · 0 评论