結果

問題 No.1880 Many Ways
ユーザー ああいいああいい
提出日時 2022-03-19 00:13:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 54,336 KB
最終ジャッジ日時 2024-04-14 12:57:27
合計ジャッジ時間 15,074 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

A = int(input())

edge = []
edge.append((1,39 + 1))
edge.append((1,40 + 1))
for i in range(2,38 + 1):
    edge.append((i,i+1))
edge.append((38 + 1,128))
for i in range(39 + 1,39 + 1 + 2 * 39,2):
    edge.append((i,i+2))
    #if i + 3 < 40 + 2 * 39:
    edge.append((i,i+3))
    edge.append((i+1,i+3))
    edge.append((i+1,i+2))
for k in range(40):
    mask = 1 << k
    if A & mask:
        if k < 39:
            edge.append((39 + 1 + k * 2,k + 2))
        else:
            edge.append((39 + 1 + 2 * k,128))

print(128,len(edge))
for a,b in edge:
    print(a,b)
0