随笔分类 - 【数学】
摘要:time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The annual college sports-ball tournamen
阅读全文
摘要:time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a building where Polycarp lives there
阅读全文
摘要:Time limit per test1 second memory limit per test 256 megabytes input standard input output standard output For a given positive integer n denote its
阅读全文
摘要:【问题描述】你是能看到第二题的friends呢。——laekovHja和Yjq在玩游戏,这个游戏中Hja给了Yjq两个数,希望Yjq找到一些非负整数使得这些数的和等于n,并且所有数模maaaaaaaaaaaaaa 的值互不相同,求方案数。【输入格式】一行两个整数。【输出格式】一行一个整数代表答案对取
阅读全文
摘要:题目描述 长度为的铁丝,你可以将其分成若干段,并把每段都折成一个三角形。你还需要保证三角形的边长都是正整数并且三角形两两相似,问有多少种不同的分法。 数据范围 1≤≤10^6 题解: ①相似三角形一定可以找到最小的那个,称为这类相似三角形的基。 ②剩下就是一包夹杂容斥的递推: ③设w[i]为长度为
阅读全文
摘要:题目描述 Hja特别有钱,他买了一个×的棋盘,然后Yjq到这个棋盘来搞事。一开始所有格子都是白的,Yjq进行次行操作次列操作,所谓一次操作,是将对应的行列上的所有格子颜色取反。现在Yjq希望搞事之后棋盘上有个黑色格子,问Yjq 有多少种搞事的方法。 数据范围 1≤,,,≤100000,0≤≤×M
阅读全文
摘要:题目描述 给定n个数ai,求sgcd(a1,a1),sgcd(a1,a2),…,sgcd(a1,an)。 其中sgcd(x,y)表示x和y的次大公因数。若不存在次大公因数,sgcd(x,y)=-1。 数据范围 n<=10^5,ai<=10^12。 题解: ①关键在于快速求出次大公因数。 ②次大
阅读全文

浙公网安备 33010602011771号