結果

問題 No.1185 完全な3の倍数
ユーザー だれだれ
提出日時 2020-08-22 18:37:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 376 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-23 12:08:30
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,880 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 30 ms
10,880 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 30 ms
10,880 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
testcase_23 AC 30 ms
10,880 KB
testcase_24 WA -
testcase_25 AC 30 ms
10,880 KB
testcase_26 WA -
testcase_27 AC 29 ms
10,880 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 WA -
testcase_31 WA -
testcase_32 RE -
testcase_33 RE -
testcase_34 WA -
testcase_35 RE -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 RE -
testcase_41 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

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