
ACM_数论
Rotepad
语言表述能力不行,在前面解释的不清,但是在代码中基本上每一个难懂的语句都在旁边有注释进行解释。
因为个人习惯带着代码去看题解,所以习惯把题解切入代码中,所以希望大家不要看到没什么解释就不看了,实际上后面的代码写的很详细
展开
-
Codeforces - 66D - Petya and His Friends(数论质数+思维)
题目:Little Petya has a birthday soon. Due this wonderful event, Petya's friends decided to give him sweets. The total number of Petya's friends equals ton.Let us remind you the definition of the g...原创 2019-08-05 02:27:56 · 332 阅读 · 0 评论 -
Gym - 101972J - Even Numbers(组合数+规律)
题目:Yousef loves playing with functions in his free time. Today, he invents the following function:Yousef will give you a list of queries, and you need to find the answers for them. For each quer...原创 2019-08-06 00:22:20 · 274 阅读 · 0 评论 -
Gym - 101466C - Planet Communcation(向量法+gcd+(hash or map) )
题目:Gym - 101466C题意:给定一个标准点坐标跟其他n-1个点的坐标,问从标准点最少射多少条线能把所有点都通过一遍题解:用向量,找三个数的gcd:,然后除以gcd得到类似一个单位向量的,然后再hash判断当前的hash对应有多少个,本来想用set的,结果不会搞,后来发现map,vector可以直接判重:vector<pair<pair<double,do...原创 2019-08-13 00:13:25 · 287 阅读 · 0 评论 -
CodeForces - 851C-Five Dimensional Points(平面几何+数学)
题目:CodeForces - 851C题意:一个5维坐标图中能够找到点a,点a满足与任意两个点b,c所成直线的夹角不为锐角题解:直接暴力枚举点,然后用arccos公式求得两直线所成夹角度数,具体方法可以去传送门看一下代码://Ö±½Ó±©Á¦£¬×¢Ò⻡¶Èת½Ç¶È #include<bits/stdc++.h>#define N 1005//#def...原创 2019-08-22 16:54:29 · 265 阅读 · 0 评论 -
BZOJ - 5028 -小Z的加油店(线段树+区间更新+gcd)
题目:BZOJ - 5028题解:扩展裴蜀定理+差分+线段树求从l到r的最小能得到的油量就是求l~r范围内a[i]的gcd由性质gcd(a,b)=gcd(a,b-a)可得区间gcd可变为:gcd( a[l], a[l+1], a[l+2],..., a[r] ) = gcd( a[l], a[l+1] - a[l] , a[l+2] - a[l+1] ,..., a[r] - ...原创 2019-09-29 15:13:10 · 255 阅读 · 0 评论