提出 #31708460


ソースコード 拡げる

s = input()
answer = 0
for i in range(1 << len(s) - 1):
    current_sum = 0
    current_num = int(s[0])
    for j in range(len(s) - 1):
        if (i >> j) & 1 == 1:
            current_sum += current_num
            current_num = 0
        current_num = current_num * 10 + int(s[j + 1])
    answer += current_sum + current_num
print(answer)

提出情報

提出日時
問題 C - たくさんの数式
ユーザ Pro_ktmr
言語 PyPy3 (7.3.0)
得点 300
コード長 352 Byte
結果 AC
実行時間 78 ms
メモリ 67828 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果 AC
AC × 12
セット名 テストケース
Sample
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
01.txt AC 78 ms 67804 KiB
02.txt AC 61 ms 67724 KiB
03.txt AC 61 ms 67808 KiB
04.txt AC 52 ms 61404 KiB
05.txt AC 52 ms 61696 KiB
06.txt AC 54 ms 62024 KiB
07.txt AC 59 ms 67620 KiB
08.txt AC 60 ms 67540 KiB
09.txt AC 52 ms 61448 KiB
10.txt AC 51 ms 61536 KiB
sample_01.txt AC 52 ms 61736 KiB
sample_02.txt AC 60 ms 67828 KiB