数学
早晨OvO
这个作者很懒,什么都没留下…
展开
-
数学-Codeforces-1316C-Primitive Primes
题目链接题意:f(x)=a0+a1 x+a2 x^2+…+an x ^ (n-1)g(x)=b0+b1 x+b2 x^2+…+bn x ^ (n-1)h(x)=f(x)g(x)=c0+c1 x+c2 x^2+…+cn x ^ (n-1)给出a0,a1,…,an b0,b1,…,bn 和一个质数p任意找到一个cx%p!=0(保证存在)思路:c0=a0+b0c1=a0b1...原创 2020-03-12 09:22:02 · 208 阅读 · 0 评论 -
数学-Codeforces-1305C- Kuroni and Impossible Calculation
题目链接容斥原理:题意:给出a1,a2,a3,…,an计算|a1-a2||a1-a3|…|a1-an||a2-a3||a2-a4|…*|an-1-an|%m的结果思路:因为是对m取余后的结果ax%m的结果一定在0~m之间,有m+1个可能所以当n大于m的时候 一定会存在两个a%m结果相同所以一定会存在|ax-ay|%m=0因此n大于m的时候结果为0代码:#include <...原创 2020-03-12 09:03:17 · 125 阅读 · 0 评论 -
数学-素数法求因子个数
1≤n≤10^12★找出1~sqrt(n)中所有素数ll k=sqrt(n);for (i = 2; i <= k; i++){ if (flag[i] == 0) { cnt++; prime[cnt] = i; for (j = 2;; j++) { if (i * j >...原创 2020-03-12 08:55:01 · 370 阅读 · 0 评论 -
数学 想法-Codeforces-1244E Minimizing Difference
题目链接代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 100005, maxm = (1 << 20) + 5;#define INF 0x3f3f3f3fconst long long mod = 1000000007;/******...原创 2019-10-21 19:24:47 · 113 阅读 · 0 评论 -
数学-Codeforces-1244C-The Football Season
题目链接代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 100005, maxm = (1 << 20) + 5;#define INF 0x3f3f3f3fll gcd(ll c, ll d){ ll h; ll k =...原创 2019-10-15 19:49:48 · 168 阅读 · 0 评论 -
数学-Codeforces-1152C Neko does Maths
C. Neko does Mathstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNeko loves divisors. During the latest number theory lesson, he got an inter...原创 2019-04-30 21:15:39 · 150 阅读 · 0 评论