結果

問題 No.1880 Many Ways
ユーザー tamatotamato
提出日時 2022-03-18 22:49:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 924 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,288 KB
実行使用メモリ 54,376 KB
最終ジャッジ日時 2024-04-14 10:56:49
合計ジャッジ時間 14,815 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,224 KB
testcase_01 WA -
testcase_02 AC 38 ms
53,420 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 38 ms
52,992 KB
testcase_06 AC 39 ms
53,420 KB
testcase_07 AC 38 ms
53,084 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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
    K = 83
    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 * 2 + 2].append(l * 2 + 4)
        adj[l * 2 + 2].append(l * 2 + 5)
        adj[l * 2 + 3].append(l * 2 + 4)
        adj[l * 2 + 3].append(l * 2 + 5)
        adj[K + l].append(K + l + 1)
    adj[N].append(K - 1)
    for lv in range(1, L):
        if A >> lv & 1:
            v = lv * 2 + 2
            u = K + lv + 1
            if u > N:
                u = K - 1
            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