
快速幂
永夜莫明
菜是原罪
展开
-
快速幂模板题
Given a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test ca...原创 2018-11-03 21:18:25 · 312 阅读 · 0 评论 -
快速幂
In this problem you are to calculate the sum of all integers from 1 to n, but you should take all powers of two with minus in the sum.For example, for n = 4 the sum is equal to - 1 - 2 + 3 - 4 = - ...原创 2018-11-03 21:40:05 · 112 阅读 · 0 评论 -
A Math Problem
You are given a positive integer n, please count how many positive integers k satisfy k^k≤n.InputThere are no more than 50 test cases.Each case only contains a positivse integer n in a line.1≤n≤10...原创 2018-12-06 23:26:26 · 226 阅读 · 0 评论 -
Dandelion(卡特兰数+费马小定理求逆元)
题目链接:http://whu2019.contest.codeforces.com/group/YyBKO8xFiH/contest/102167/problem/DD. Dandeliontime limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard o...原创 2019-04-08 17:48:29 · 408 阅读 · 0 评论 -
求小数点后第几位数(模拟+快速幂)
链接:https://ac.nowcoder.com/acm/contest/548/B来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述立华奏在学习初中数学的时候遇到了这样一道大水题:“设箱子内有 n 个球,其中给 m 个球打上标记,设一次摸球摸到每一个球的概...原创 2019-05-21 15:50:42 · 645 阅读 · 0 评论