結果

問題 No.1185 完全な3の倍数
ユーザー だれ
提出日時 2020-08-22 18:37:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 376 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-15 12:07:35
合計ジャッジ時間 2,719 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other AC * 7 WA * 20 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n=input()
def wow(n):
    if len(n)<3:
        count=0
        for i in range(10,100):
            if i%3==0:
                count+=1
        print(count)
        exit()
    ans=0
    nl=len(n)
    for i in range(2,nl-1):
        ans+=3*(4**i)
    if int(n[0])%3!=0:
        return((int(n[0])//3+1)*ans+30)
    else:
        return (int(n[0])//3)*ans+wow[n[1:]]
print(wow(n))
0