結果
問題 | No.1589 Bit Vector |
ユーザー |
![]() |
提出日時 | 2021-07-08 23:23:36 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 76,864 KB |
最終ジャッジ日時 | 2024-07-01 13:14:16 |
合計ジャッジ時間 | 3,920 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline def bsort(i): ans.append("XOR {0} {1} {2}".format(N, i, i+1)) ans.append("AND {0} {1} {2}".format(i, i, i+1)) ans.append("AND {0} {1} {2}".format(i+1, i, i+1)) ans.append("XOR {0} {1} {2}".format(i+1, i+1, N)) N, K = map(int, input().split()) ans = [] for i in range(N-1, -1, -1): for j in range(i): bsort(j) ans.append("UPD {0} {1}".format(N, 0)) ans.append("XOR {0} {1} {2}".format(N, N-K, N)) print(len(ans)) for S in ans: print(S) if __name__ == '__main__': main()