結果

問題 No.2607 Add One Digit
ユーザー naut3
提出日時 2024-01-19 21:25:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-28 03:54:55
合計ジャッジ時間 1,361 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    S = list(input())

    L = len(S)
    pattern = set()
    nums = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]

    for i in range(L + 1):
        for n in nums:
            if i == 0 and n == "0":
                continue

            T = S[:]
            T.insert(i, n)
            T = int("".join(T))
            pattern.add(T)

    print(len(pattern))
    return 0


main()
0