![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
文章平均质量分 77
Mitsuha_
Rush to the dead summer
展开
-
HDU-6750:Function(容斥)
FunctionTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description学皇最近发明了一种新的玩具––学皇筛。他对于最大公约数为 111 的数对特别着迷,想知道满足以下奇妙性质的 nnn 的因子集合。记 nnn 的一个因子为 ttt,若 ttt 与 nt\frac nttn 的最大公约数为 1,则称 nnn 的这个因子为“有趣的”。X 同学已经很熟练地掌握原创 2021-06-22 00:03:10 · 199 阅读 · 0 评论 -
Codeforces-gym/101853G:Hard Equation(BSGS)
G. Hard Equationtime limit per test 10.0 smemory limit per test 256 MBinputs tandard inputoutputs tandard outputConsider the following equationax≡bmodma^x\equiv b\quad mod\quad max≡bmodmGiven a, ...原创 2019-02-15 16:21:04 · 522 阅读 · 0 评论 -
Codeforces-1106F:Lunar New Year and a Recursive Sequence(矩阵快速幂+BSGS)
F. Lunar New Year and a Recursive Sequencetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLunar New Year is approaching, and Bob received a g...原创 2019-02-05 13:51:20 · 809 阅读 · 0 评论 -
Codeforces-1097D:Makoto and a Blackboard(期望+DP)
D. Makoto and a Blackboardtime limit per test 2 secondsmemory limit per test 256 megabytesinputstandard inputoutputstandard outputMakoto has a big blackboard with a positive integer n written on ...原创 2019-01-05 13:41:20 · 553 阅读 · 0 评论 -
2018-2019 ICPC, NEERC, Northern Eurasia Finals(F,K)
2018-2019 ICPC, NEERC, Northern Eurasia FinalsProblem F:Fractions思路:看懂题意之后,相当于求解x1n+x2n+x3n+⋯+xkn=n−1n\frac {x_1}{n}+\frac {x_2}{n}+\frac {x_3}{n}+\dots +\frac {x_k}{n}=\frac {n-1}{n}nx1+nx2+nx3...原创 2018-12-03 13:56:01 · 906 阅读 · 0 评论 -
牛客练习赛29-F:算式子
链接:https://www.nowcoder.com/acm/contest/211/F时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述给定 nnn个整数a1,a2,...,ana_1,a_2,...,a_na1,a2,...,an 。保证1≤ai≤m1\le a_i\le m...原创 2018-10-21 23:08:52 · 351 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第九场)H:Prefix Sum(组合数学相关)
链接:https://www.nowcoder.com/acm/contest/147/H时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Niuniu has learned prefix sum and he found an interesting about prefi...原创 2018-08-17 11:25:00 · 647 阅读 · 1 评论 -
HDU-6363:bookshelf(数论+容斥)
bookshelf Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description Patrick Star bought a bookshelf, he named it ZYG !! Patrick Star has NNN book .Th...原创 2018-08-10 17:34:12 · 338 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第四场)A:Ternary String(扩展欧拉定理降幂)
链接:https://www.nowcoder.com/acm/contest/142/A时间限制:C/C++ 4秒,其他语言8秒 空间限制:C/C++ 131072K,其他语言262144K 64bit IO Format: %lld 题目描述 A ternary string is a sequence of digits, where each digit is either ...原创 2018-07-29 20:06:23 · 255 阅读 · 0 评论 -
WOJ-701:阶乘幂(拓展欧拉定理降幂)
利用拓展欧拉定理降幂。我们发现对一个数取欧拉函数,log次就会变成1,而任何数模1肯定=0,所以就可以算出来了。然而有的后面的phi[m]这一项需要加,有的不需要加。因为这个不断地幂次增长速度极快,很少几项就能够增长到远大于模数的地步。所以我们可以先暴力处理前几项判断即可。#include<bits/stdc++.h>using namespace std;typedef long...原创 2018-07-14 14:37:29 · 790 阅读 · 0 评论 -
牛客练习赛22-E:简单数据结构1(拓展欧拉定理降幂)
链接:https://www.nowcoder.com/acm/contest/132/E时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述 给一个长为n的序列,m次操作,每次操作: 1.区间加 2.对于区间,查询 ,一直到- 请注意每次的模数不同。 输入描述:第一行两个整数 n,...原创 2018-07-14 13:19:03 · 431 阅读 · 0 评论 -
WUST OJ 1361:The Gougu Theorem(毕达哥拉斯三元组)
1361: The Gougu TheoremTime Limit: 1 Sec Memory Limit: 128 MB 64bit IO Format: %lldSubmitted: 25 Accepted: 4[Submit][Status][Web Board]DescriptionPythagorean Theorem is "humanity's greatest scient...原创 2018-04-27 00:07:51 · 389 阅读 · 0 评论 -
ACM-ICPC 2017 Asia Urumqi: K. Sum of the Line(容斥)
Consider a triangle of integers, denoted by T. The value at (r,c) is denoted by Tr,c, where 1≤r and 1≤c≤r. If the greatest common divisor of r and c is exactly 1, Tr,c=c, or 0 otherwise.Now, we have...原创 2018-02-10 21:38:30 · 959 阅读 · 0 评论 -
Codeforces-199C:About Bacteria(数学)
C. About Bacteriatime limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Qwerty the Ranger took up a government job and arrived on planet Mars.原创 2018-01-05 11:54:19 · 430 阅读 · 0 评论 -
ZOJ-3768:Continuous Login(打表找规律+暴力)
ZOJ-3768:Continuous Login(打表找规律+暴力)Pierre is recently obsessed with an online game. To encourage users to log in, this game will give users a continuous login reward. The mechanism of continuous login reward is as follows: If you have not logged in on a ce原创 2017-12-25 08:50:54 · 427 阅读 · 0 评论 -
HDU-6237:A Simple Stone Game(数论)
HDU-6237:A Simple Stone Game(数论)After he has learned how to play Nim game, Bob begins to try another stone game which seems much easier.The game goes like this: one player starts the game with N piles of stones. There is ai stones on the ith pile. On one原创 2017-11-11 22:36:22 · 687 阅读 · 0 评论 -
Codeforces-258C:Little Elephant and LCM(数论)
Codeforces-258C:Little Elephant and LCM(数论)The Little Elephant loves the LCM (least common multiple) operation of a non-empty set of positive integers. The result of the LCM operation of k positive integers x1, x2, ..., xk is the minimum positive integer t原创 2017-10-21 22:16:47 · 511 阅读 · 0 评论 -
HDU-5924:Mr. Frog’s Problem(不等式变换)
HDU-5924:Mr. Frog’s Problem(不等式变换)One day, you, a clever boy, feel bored in your math class, and then fall asleep without your control. In your dream, you meet Mr. Frog, an elder man. He has a problem for you.原创 2017-10-12 16:58:08 · 448 阅读 · 0 评论 -
2017 ACM-ICPC 亚洲区(西安赛区)网络赛: B. Coin
2017 ACM-ICPC 亚洲区(西安赛区)网络赛:B.Coin Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(\frac{q}{p} \le \frac{1}{2})原创 2017-09-16 19:30:33 · 1365 阅读 · 0 评论 -
2017 ACM-ICPC 亚洲区(西安赛区)网络赛: F. Trig Function
f(cos(x))=cos(n∗x) holds for all x.Given two integers n and m, you need to calculate the coefficient of x^m in f(x), modulo 998244353.Input FormatMultiple test cases (no more than 100).Each test case原创 2017-09-16 18:30:41 · 331 阅读 · 0 评论 -
Codeforces-682A:Alyona and Numbers(水题)
Codeforces-682A:Alyona and Numbers(水题)After finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers — the first column containing integers from 1 to n and the second containing integers from 1 t原创 2017-09-15 19:48:42 · 507 阅读 · 0 评论 -
POJ-2109:Power of Cryptography
POJ-2109:Power of CryptographyCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of results from number theory and other bra原创 2017-08-30 19:11:02 · 300 阅读 · 0 评论 -
POJ 2689:Prime Distance
POJ 2689:Prime DistanceThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of primality. A prime number is a number th原创 2017-08-23 21:10:38 · 528 阅读 · 0 评论 -
ZOJ 3449:Doraemon's Number Game III
ZOJ 3449:Doraemon's Number Game IIIDoraemon likes to play number game with Nobita.One day, Doraemon came up with an idea, he gave a number a in base 10 and a number x (x < 10), and then he let Nobita multiplies the first digit of a with x and add the sec原创 2017-08-14 17:57:54 · 355 阅读 · 0 评论 -
CodeForces - 76E :Points
E. Pointstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given N points on a plane. Write a program原创 2017-08-07 19:21:11 · 457 阅读 · 0 评论