結果
問題 | No.1589 Bit Vector |
ユーザー | SSRS |
提出日時 | 2021-07-08 23:08:50 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,627 bytes |
コンパイル時間 | 1,876 ms |
コンパイル使用メモリ | 185,836 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 13:10:33 |
合計ジャッジ時間 | 9,078 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 3 ms
6,940 KB |
testcase_26 | AC | 3 ms
6,940 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N, K; cin >> N >> K; int T; cin >> T; vector<vector<int>> C(T, vector<int>(N)); for (int i = 0; i < T; i++){ for (int j = 0; j < N; j++){ cin >> C[i][j]; } } vector<tuple<string, int, int, int>> op; for (int i = 0; i < T; i++){ vector<int> p; for (int j = 0; j < N; j++){ if (C[i][j] == 1){ p.push_back(j); } } if (p.size() >= K){ vector<bool> A(N, false); for (int j = 0; j < K; j++){ A[p[j]] = true; } op.push_back(make_tuple("UPD", N, 1, 0)); for (int j = 0; j < K; j++){ op.push_back(make_tuple("AND", N, p[j], N)); } op.push_back(make_tuple("XOR", N, p[0], N)); for (int j = 0; j < K; j++){ op.push_back(make_tuple("XOR", j, p[0], j)); op.push_back(make_tuple("AND", j, j, N)); op.push_back(make_tuple("XOR", j, p[0], j)); } op.push_back(make_tuple("XOR", N, p[0], N)); } } op.push_back(make_tuple("UPD", N, 1, 0)); for (int i = 0; i < K; i++){ op.push_back(make_tuple("AND", N, i, N)); } int cnt = op.size(); assert(cnt <= 10000); cout << cnt << endl; for (int i = 0; i < cnt; i++){ if (get<0>(op[i]) == "UPD"){ cout << "UPD " << get<1>(op[i]) << ' ' << get<2>(op[i]) << endl; } if (get<0>(op[i]) == "AND"){ cout << "AND " << get<1>(op[i]) << ' ' << get<2>(op[i]) << ' ' << get<3>(op[i]) << endl; } if (get<0>(op[i]) == "XOR"){ cout << "XOR " << get<1>(op[i]) << ' ' << get<2>(op[i]) << ' ' << get<3>(op[i]) << endl; } } }