結果

問題 No.1589 Bit Vector
ユーザー shotoyoo
提出日時 2021-09-26 12:34:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 77,696 KB
最終ジャッジ日時 2024-07-05 15:36:09
合計ジャッジ時間 11,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 2 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


n,k = list(map(int, input().split()))
n = 100
t = int(input())
import random
_a = [random.randint(0,1) for _ in range(n+1)]
def UPD(i, v):
    print("UPD", i, v)
    _a[i] = v
def AND(i, j, k):
    print("AND", i, j, k)
    _a[k] = _a[i] and _a[j]
def XOR(i, j, k):
    print("XOR", i, j, k)
    _a[k] = _a[i]^_a[j]
def swap(i,j):
    UPD(n,1)
    AND(i, j, i)
    XOR(j, n, j)
    XOR(i, n, n)
    AND(j, n, j)
    UPD(n,1)
    XOR(j, n, j)
for i in range(1,n):
    for j in range(i)[::-1]:
        swap(j,j+1)
UPD(n,0)
XOR(k-1,n,n)
0