0w1

Offline

Monthly Training Farm - May 2017 D. oeis1 ( Offline )

https://oj.icpc.tw/contest/5/problem/DProblem Description: Define f( x ) as sum of digits of x, g( x ) as product of digits greater than 0 of x. Let D[ 1 ] = 8. D[ i ] = sum( f( D[ j ] ) + g( D[ j ] ) + 10 for j in range( 1, i ) ). Print D…

Yuki 502 階乗を計算するだけ ( Offline )

No.502 階乗を計算するだけ - yukicoder題意: 給 n,求 X: X = n! mod (1e9+7)制約: 0 ≤ n ≤ 1e18解法: 首先 n ≥ 1e9 + 7 時,X 顯然為 0。 本地建表,將 1e7 的倍數都填上去,那麼計算量便是至多 1e7。 MOD = int( 1e9 + 7 ) ''' Used for offline prep…