結果

問題 No.2246 1333-like Number
ユーザー Yuu EguciYuu Eguci
提出日時 2023-04-04 18:39:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 978 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2024-04-08 17:59:46
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,112 KB
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 31 ms
10,112 KB
testcase_03 AC 30 ms
10,112 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 32 ms
10,112 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

c, remainder = divmod(N, 36)

# NOTE: dict ではなく list にしたほうがカッコイイけど、
#       余りの値: a, b という対応にしたほうが分かりやすいと思ったので。
a, b = {
    1: (1, 2),
    2: (1, 3),
    3: (1, 4),
    4: (1, 5),
    5: (1, 6),
    6: (1, 7),
    7: (1, 8),
    8: (1, 9),
    9: (2, 3),
    10: (2, 4),
    11: (2, 5),
    12: (2, 6),
    13: (2, 7),
    14: (2, 8),
    15: (2, 9),
    16: (3, 4),
    17: (3, 5),
    18: (3, 6),
    19: (3, 7),
    20: (3, 8),
    21: (3, 9),
    22: (4, 5),
    23: (4, 6),
    24: (4, 7),
    25: (4, 8),
    26: (4, 9),
    27: (5, 6),
    28: (5, 7),
    29: (5, 8),
    30: (5, 9),
    31: (6, 7),
    32: (6, 8),
    33: (6, 9),
    34: (7, 8),
    35: (7, 9),
    0: (8, 9),
}[remainder]


def calculate_answer(a: int, b: int, c: int) -> int:
    x = 10 * a + b
    for _ in range(c):
        x = 10 * x + b
    return x


print(calculate_answer(a, b, c))
0