結果

問題 No.1880 Many Ways
ユーザー ああいいああいい
提出日時 2022-03-19 00:14:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 564 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,484 KB
実行使用メモリ 54,584 KB
最終ジャッジ日時 2024-04-14 12:58:33
合計ジャッジ時間 14,776 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,776 KB
testcase_01 AC 37 ms
52,892 KB
testcase_02 AC 39 ms
53,632 KB
testcase_03 AC 39 ms
54,500 KB
testcase_04 AC 39 ms
53,804 KB
testcase_05 AC 38 ms
53,052 KB
testcase_06 AC 38 ms
53,808 KB
testcase_07 AC 39 ms
53,348 KB
testcase_08 AC 39 ms
53,868 KB
testcase_09 AC 39 ms
54,584 KB
testcase_10 AC 39 ms
53,692 KB
testcase_11 AC 39 ms
54,220 KB
testcase_12 AC 39 ms
53,316 KB
testcase_13 AC 38 ms
53,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A = int(input())

edge = []
edge.append((1,39 + 2))
edge.append((1,40 + 2))
for i in range(2,38 + 2):
    edge.append((i,i+1))
edge.append((38 + 2,128))
for i in range(39 + 2,39 + 2 + 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 + 2 + k * 2,k + 2))
        else:
            edge.append((39 + 2 + 2 * k,128))

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