
数学
文章平均质量分 79
FFOYeah
这个作者很懒,什么都没留下…
展开
-
Codefroces 384 D.Taxes(哥德巴赫猜想,三素数定理)
Codefroces 384 DMr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and the amount of tax he has to pay is calcu...原创 2018-02-12 21:58:41 · 931 阅读 · 0 评论 -
【异或】HDU - 4810 Wall Painting
Wall PaintingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3857 Accepted Submission(s): 1278Problem DescriptionMs.Fang loves painting very much. She paints GFW(Great Funny Wall) every day.原创 2018-08-09 14:57:39 · 243 阅读 · 0 评论 -
#数论、离散化、树状数组# 2018中国大学生程序设计竞赛 - 网络选拔赛
题目链接 1001. Buy and ResellProblem DescriptionThe Power Cube is used as a stash of Exotic Power. There are n cities numbered 1,2,…,n where allowed to trade it. The trading price of the Power Cub...原创 2018-08-27 22:31:54 · 352 阅读 · 0 评论 -
"字节跳动杯"2018中国大学生程序设计竞赛-女生专场(ing)
1002. 口算训练题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6287Problem Description小Q非常喜欢数学,但是他的口算能力非常弱。因此他找到了小T,给了小T一个长度为n的正整数序列a1,a2,...,an,要求小T抛出m个问题以训练他的口算能力。每个问题给出三个正整数l,r,d,小Q需要通过口算快速判断al×al...原创 2018-08-24 23:25:47 · 855 阅读 · 0 评论 -
#数论、分层最短路# ACM-ICPC 2018 南京赛区网络预赛
题目链接An Olympian Math ProblemAlice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about the problem...原创 2018-09-04 21:44:58 · 269 阅读 · 0 评论 -
#数论# 快速分解质因数的技巧 && 筛法求素数(快速筛)
快速分解质因数在做题时经常遇到要分解质因数,那么如何快速分解质因数呢?在用筛法求素数时,我们使用线性筛的方法,并在每次筛的过程中,记录下每个数的最小质因数。那么在分解质因数的时候,只需要不断除以当前数的最小质因数,就可以快速得到分解的质因数了。给出一个简单的例子,比如我们要求 50 这个数的质因数:首先,利用线性筛找到所有的素数,并记录非素数的最小质因数,然后再将数字 50 除以他...原创 2018-09-17 21:46:31 · 2748 阅读 · 0 评论 -
【容斥】2017 ACM Arabella Collegiate Programming Contest
比赛连接G. Snake RanaOld Macdonald wants to build a new hen house for his hens. He buys a new rectangular area of size N by M. The night before he builds the hen house, snake Rana devises an evil plan t...原创 2019-03-19 12:40:16 · 273 阅读 · 0 评论 -
【数论】【DP】【LCM】2018 USP-ICMC【待补】
比赛传送门A. Nicoleta and the circle of kidsDescription每个人可以连边,最远连到第(i+k)%n 个人,边权为两个人之间的距离,求最大生成树Range1 ≤ K < N ≤ 1e9Solution方案一:LCM如果每个人都选取最优的连边策略,假设在人数可以无限扩大的前提下,那么每个人都可以向接下来的第k个人连边,很容易得出一个循环节...原创 2019-04-15 01:28:54 · 535 阅读 · 6 评论 -
【期望】【DP】数学期望总结(ing)
LightOJ - 1027 A Dangerous Maze原创 2019-08-15 19:51:03 · 537 阅读 · 0 评论 -
#&运算# 牛客练习赛23 C.托米的位运算
链接:https://www.nowcoder.com/acm/contest/156/C时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述托米完成了1317的上一个任务,十分高兴,可是考验还没有结束说话间1317给了托米 n 个自然数 a1... an, 托米可以选出一些带回家,...原创 2018-08-04 21:21:25 · 288 阅读 · 0 评论 -
异或、异或和 的性质及应用总结
一:异或的含义或在数学中的含义:一个元素在集合A中或在集合B中,或的维恩图如下:而异或是不允许共存的,所以 A ^ B 的维恩图如下:同理对于 A ^ B ^ C 维恩图: 异或运算{\displaystyle A\oplus B} 的真值表如下:F表示false,T代表trueA B ⊕ F F F F T T ...原创 2018-08-04 17:19:48 · 21704 阅读 · 2 评论 -
#数论# 欧几里德算法 、扩展欧几里德算法 、费马小、逆元求解(ing)
欧几里德求gcd(辗转相除法):定理:gcd(a, b) = gcd(b, a % b) 两个正整数a和b(a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;b),它们的最大公约数等于a除以b的余数c和b之间的最大公约数证明:a可以表示成a = kb + r,则r = a % b;假设d是a, b的一个公约数,则有a % d = 0,b % d = 0,由于r = a - kb原创 2018-05-25 00:18:34 · 412 阅读 · 0 评论 -
#最短路、gcd、DP# 2017杭州女生赛
C. Coprime Sequence题目链接Problem Description Do you know what is called Coprime Sequence”? That is a sequence consists of n positive integers, and the GCD (Greatest Common Divisor) of them is equ...原创 2018-05-15 20:18:18 · 442 阅读 · 0 评论 -
#错排问题# 不容易系列之(4)——考新郎
题目链接Problem Description 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做”考新郎”,具体的操作是这样的:首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个. 最后,揭开盖头,如果找错了对象就要当众跪搓衣板…...原创 2019-09-10 21:04:31 · 427 阅读 · 0 评论 -
2018 Multi-University Training Contest 1
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6301 1001. Maximum MultipleTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 531 A...原创 2018-07-23 23:40:51 · 253 阅读 · 0 评论 -
#矩阵前缀和# Codeforces C. Star sky
题目链接:http://codeforces.com/problemset/problem/835/CC. Star skytime limit per test 2 secondsmemory limit per test 256 megabytesThe Cartesian coordinate system is set in the sky. There you c...原创 2018-07-17 01:17:07 · 369 阅读 · 0 评论 -
Codeforces Round #430 (Div. 2) C. Ilya And The Tree
题目链接C. Ilya And The Treetime limit per test 2 secondsmemory limit per test 256 megabytesIlya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very inte...原创 2018-07-19 02:54:29 · 199 阅读 · 0 评论 -
#概率期望# Codeforces Round #341 (Div. 2) C. Wet Shark and Flowers
题目链接C. Wet Shark and FlowersThere are n sharks who grow flowers for Wet Shark. They are all sitting around the table, such that sharks i and i + 1 are neighbours for all i from 1 to n - 1. Sharks ...原创 2018-07-25 22:54:17 · 225 阅读 · 0 评论 -
Codeforces Technocup 2018 - Elimination Round 2 C. Maximum splitting
题目链接You are given several queries. In the i-th query you are given a single positive integer ni. You are to represent ni as a sum of maximum possible number of composite summands and print this maxi...原创 2018-07-26 16:21:57 · 227 阅读 · 0 评论 -
线性基总结(ing)
一篇超棒的博客另一篇很棒的博客前言可以将线性基理解为是将一个序列处理完之后得到的产物。线性基是一个集合,在原集合中找到一个子集,子集中的数异或起来一定能在线性基中找一个对应子集的异或和与其相等。比如说,{x,y} 和 {x, x^y} 就满足这样一个关系。性质原序列里面的任意一个数都有唯一方案由线性基中元素异或得到。在线性基中任取若干个元素,它们的异或不为零。即它们线性无关。线性...原创 2019-08-22 16:27:08 · 302 阅读 · 0 评论