結果

問題 No.2965 Don't Stop the Game again
ユーザー 👑 rin204
提出日時 2024-11-16 22:09:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,024 ms
コード長 496 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-11-16 22:09:59
合計ジャッジ時間 5,976 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

n = 50
m = int(input())
Q = list(map(int, input().split()))

ope = []
for i in range(1, 51):
    ope.append(f"1 {i}")

x = Q.index(1) + 1
A = [i for i in range(1, n + 1) if i != x]
for i in range(1, 30):
    ope.append(f"4 {A[i - 1]} {A[i - 1]} {A[i]}")

idx = []
for i in range(30):
    if m >> i & 1:
        idx.append(i)

p = A[idx[0]]
for i in range(1, len(idx)):
    ope.append(f"4 {A[idx[i]]} {p} {p}")

for a in A:
    ope.append(f"3 {a} {p} {a}")


print(len(ope))
print(*ope, sep="\n")
0