关闭

BZOJ 1072 [SCOI2007]排列perm (状态压缩+dp+同余定理)

1072: [SCOI2007]排列perm Time Limit: 10 Sec Memory Limit: 128 MB Submit: 2537 Solved: 1583 [Submit][Status][Discuss] Description   给一个数字串s和正整数d, 统计s有多少种不同的排列能被d整除(可以有前导0)。例如123434有90种排列能 被2整除,其中末位为2的有30种,末位为4的有60种。 Input   输入第一行是一个整数T,表示测试数据的个数,以下每行一组s...
阅读(253) 评论(0)

HDU 6063 RXD and math (数论+快速幂)

RXD and math Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 1363 Accepted Submission(s): 747 Problem Description RXD is a good mathematician. One day he wants to calculate: ∑i=1nkμ2(i)×⌊nki−...
阅读(387) 评论(0)

HDU 5514 Frogs (容斥+数论)

Frogs Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2810 Accepted Submission(s): 904 Problem Description There are m stones lying on a circle, and n frogs are jumping over them. The stones ar...
阅读(425) 评论(0)

BZOJ 1024 生日快乐 (dfs)

传送门:点击打开链接 1024: [SCOI2009]生日快乐 Time Limit: 1 Sec  Memory Limit: 162 MB Submit: 2885  Solved: 2101 [Submit][Status][Discuss] Description   windy的生日到了,为了庆祝生日,他的朋友们帮他买了一个边长分别为 X 和 Y 的矩形蛋糕。现在...
阅读(328) 评论(0)

Educational Codeforces Round 26 E. Vasya's Function(数论)

E. Vasya's Function time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasya is studying number theory. He has denoted a function f(a, b) such that: f(a, 0) = 0; f(a, b) = 1 + f(a, b - gcd(a, b)), wher...
阅读(309) 评论(0)

codeforce B. Cutting Carrot

Igor the analyst has adopted n little bunnies. As we all know, bunnies love carrots. Thus, Igor has bought a carrot to be shared between his bunnies. Igor wants to treat a...
阅读(304) 评论(0)

HDU 1019 Least Common Multiple

题目链接:点击打开链接 题目要求求n个数的最小公约数,可以依次求出每个数的最大公倍数,然后两数相乘再除以gcd。 开始是数组接受后遍历,莫名其秒WA两次,又放在输入中直接求的,就过了,可能有小细节没处理好。 有用到欧几里得算法。 下面是大神对欧几里得算法以及扩展欧几里得的解释。点击打开链接 代码实现: #include #include #include using name...
阅读(103) 评论(0)
    个人资料
    • 访问:34532次
    • 积分:1586
    • 等级:
    • 排名:千里之外
    • 原创:127篇
    • 转载:1篇
    • 译文:0篇
    • 评论:13条
    联系方式
    欢迎谈论交流:1245985209
    博客专栏
    最新评论