2022-08-18 16:09:17 +08:00

20 lines
631 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# J - Leading and Trailing
* https://vjudge.net/contest/509210#problem/J
### 题意
n^k的前3位、后3位n (2 ≤ n < 2^31) and k (1 k 10^7).
### 做法
1. 后三位快速幂
2. 前三位10^ (log10(n^k)==k*log10(n)),整数部分决定0的个数小数部分决定数字 *100取前三位
### 关键词
快速幂求很大的n^klog10powmodf
### 易错点
* 快速幂中now=n%mod;//要mod否则会太大10e6*10e6
* 快速幂忘return
* //%03d 001 000 补齐1前面的0
* //没有int)导致没有输出
### 工具箱
* log10(n^k)==k*log10(n)
* pow(10,cur)==10^cur
* %03d 001 000 整数用零补齐
* y=modf(n,&x);n的小数部分给y,整数部分给x都是浮点数
* 题解 https://www.cnblogs.com/KirinSB/p/9409120.html