結果
問題 |
No.1589 Bit Vector
|
ユーザー |
|
提出日時 | 2021-07-09 14:54:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 921 bytes |
コンパイル時間 | 1,960 ms |
コンパイル使用メモリ | 181,576 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 13:59:51 |
合計ジャッジ時間 | 9,166 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 2 WA * 33 |
ソースコード
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; int N, K; void input_NK(void){ cin >> N >> K; } void sort_xy(int x, int y, ostringstream& oss){ oss << "UPD " << N << " 0" << endl; oss << "XOR " << N << " " << x << " " << N << endl; oss << "AND " << x << " " << x << " " << y << endl; oss << "XOR " << y << " " << y << " " << N << endl; oss << "XOR " << y << " " << x << " " << y << endl; } void sort_prefix(ostringstream& oss){ string ret = ""; for (int i = 0; i < N; ++i) for (int y = N - 1; y > i; --y) sort_xy(y - 1, y, oss); } string solve(void){ ostringstream oss; sort_prefix(oss); oss << "UPD " << N << " 0" << endl; for (int i = N - 1; i >= N - K; --i) oss << "AND " << N << " " << i << endl; return oss.str(); } int main(void){ input_NK(); cout << solve(); return 0; }