結果

問題 No.1880 Many Ways
ユーザー 👑 tamatotamato
提出日時 2022-03-18 22:55:28
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 905 bytes
コンパイル時間 999 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 71,356 KB
最終ジャッジ日時 2023-07-26 21:32:35
合計ジャッジ時間 17,291 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,208 KB
testcase_01 AC 74 ms
71,300 KB
testcase_02 AC 73 ms
71,224 KB
testcase_03 AC 75 ms
71,104 KB
testcase_04 AC 71 ms
71,236 KB
testcase_05 AC 72 ms
71,356 KB
testcase_06 AC 73 ms
71,276 KB
testcase_07 AC 73 ms
70,932 KB
testcase_08 AC 71 ms
71,244 KB
testcase_09 AC 71 ms
71,240 KB
testcase_10 AC 73 ms
71,244 KB
testcase_11 AC 73 ms
71,024 KB
testcase_12 AC 73 ms
71,208 KB
testcase_13 AC 73 ms
71,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    A = int(input())
    #if A == 0:
    #    print(2, 0)
    #    exit()

    L = 40
    N = 122
    adj = [[] for _ in range(N + 1)]
    adj[1].append(2)
    adj[1].append(3)
    # adj[1].append(83)
    for l in range(L - 1):
        adj[l * 3 + 2].append(l * 3 + 5)
        adj[l * 3 + 2].append(l * 3 + 6)
        adj[l * 3 + 3].append(l * 3 + 5)
        adj[l * 3 + 3].append(l * 3 + 6)
        adj[l * 3 + 4].append(l * 3 + 7)
    adj[N - 1].append(N)
    for lv in range(L):
        if A >> lv & 1:
            v = lv * 3 + 2
            u = v + 5
            if u > N:
                u = N
            adj[v].append(u)
    M = 0
    for v in range(1, N + 1):
        M += len(adj[v])
    print(N, M)
    for v in range(1, N + 1):
        for u in adj[v]:
            print(v, u)


if __name__ == '__main__':
    main()
0