随笔分类 - 数论
摘要:The 2019 ICPC Asia Yinchuan Regional Programming Contest/2019银川区域赛 D Easy Problem(莫比乌斯容斥+欧拉降幂) 题面: 题意: 给定4个整数$n,m,d,k$,让你求$\sum_\sum_\dots\sum_^gcd(a_
阅读全文
摘要:[HDU - 5114 ] Collision (不定方程,exgcd,分类讨论) 题目链接:HDU - 5114 题面: 题意: 每一组测试给你六个整数:\(x,y,x1,y1,x2,y2\),代表在一个长为$\mathit x$, 高为$\mathit y$ 的矩形网格中, 最初由两个小球,分别
阅读全文
摘要:BBP Formula (数学) 链接: HDU - 6217 题面: 思路: 原式: \[ \pi=\sum_{k=0}^{\infty}\frac{1}{16^k}({\frac{4}{8k+1}-\frac{2}{8k+4}-\frac{1}{8k+5}-\frac{1}{8k+6}}) \]
阅读全文
摘要:HDU- 6861 Gaming of Co-prime Disallowance (概率,莫比乌斯容斥) 题面描述: 思路: 我们考虑在一次游戏中$gcd=1$之前的$gcd$数值为$g,cnt_x$为$\mathit x$ 的倍数个数。 设 \[ f(x,k)=\frac{cnt_x-k}{n-
阅读全文
摘要:HDU - 6760 Math is Simple (差分,莫比乌斯函数) 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6760 Problem Description Here is a simple math. You are given an
阅读全文
摘要:F-Fraction Construction Problem 2020牛客暑期多校训练营(第三场)(构造,数论,exgcd) 思路: 分一下情况来讨论: 1、\(gcd(a,b)>1\): 令$k=gcd(a,b)\(,则\)\frac{a+k}-\frac=\frac{a/k+1}{b/k}-\
阅读全文
摘要:AtCoder Beginner Contest 172-F - Unfair Nim(nim博弈,二进制构造) 题意: 有$\mathit n$堆石子,每一堆有$A_i$个石头,问最少从第一堆中拿出多少个石子(也不能拿完,即拿出的石子数为$[0,A_1-1]\()放在第二堆中可以使\)\mathi
阅读全文
摘要:Codeforces Round #628 (Div. 2)] D-Ehab the Xorcist 题意: 给定两个整数$u,v(0 \le u,v \le 10^{18})$ 让你构造一个长度$\mathit n$最小的数组$arr$,使其: 1、\(arr_1 \oplus arr_2 \op
阅读全文
摘要:[Educational Codeforces Round 81 (Rated for Div. 2)] D. Same GCDs (数论,因子分解,容斥定理) D. Same GCDs time limit per test 2 seconds memory limit per test 256
阅读全文
摘要:C. Vasily the Bear and Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasily th
阅读全文
摘要:Vasya and Beautiful Arrays "CodeForces 354C " Vasya's got a birthday coming up and his mom decided to give him an array of positive integers a of leng
阅读全文
摘要:Coprime Arrays "CodeForces 915G " Let's call an array a of size n coprime iff gcd ( a 1, a 2, ..., a n ) = 1, where gcd is the greatest common divisor
阅读全文
摘要:牛客练习赛52 | C | "烹饪" | | | | | | | 链接:https://ac.nowcoder.com/acm/contest/1084/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format
阅读全文
摘要:G. List Of Integers time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output Let's denote as L (
阅读全文
摘要:F. SUM and REPLACE time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Let D(x) be the number of
阅读全文
摘要:Relatively Prime Powers "CodeForces 1036F " Consider some positive integer xx. Its prime factorization will be of form x=2k1⋅3k2⋅5k3⋅…x=2k1⋅3k2⋅5k3⋅…
阅读全文
摘要:完全平方数 "HYSBZ 2440 " 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些 数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而 这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一 个小X讨厌的数。
阅读全文
摘要:In Complexity theory, some functions are nearly O(1) O (1), but it is greater then O(1) O (1). For example, the complexity of a typical disjoint set i
阅读全文
摘要:D. Power Tower time limit per test 4.5 seconds memory limit per test 256 megabytes input standard input output standard output Priests of the Quetzalc
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/392/D 来源:牛客网 月月给华华出题 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 131072K,其他语言262144K 64bit IO Format: %lld 题目描述 因为月月是个信息学高手
阅读全文

浙公网安备 33010602011771号