結果

問題 No.1472 作為の和
ユーザー ygd.ygd.
提出日時 2021-04-09 22:51:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 76,140 KB
最終ジャッジ日時 2023-09-07 12:28:52
合計ジャッジ時間 1,719 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,320 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = [3,1,4,1,5]
pi = 3.1415926535
num = 9*(N+1)
if N == 0:
    cnt = 1
elif N <= 3:
    cnt = 0
    P = pi*pow(10,N)
    P = int(P)
    for i in range(P+1):
        ori = i
        sum = 0
        while i > 0:
            sum += i%10
            i //= 10
        if sum == 9:
            #print(ori)
            cnt += 1
else:
    cnt = 0
    P = 3141
    for i in range(P+1):
        sum = 0
        while i > 0:
            sum += i%10
            i //= 10
        if sum > 9: continue
        rest = 9 - sum
        cnt += pow(N-4,rest)
        #print(type(cnt),rest)
ans = [num,cnt]
print(*ans)
0