結果
問題 | No.1589 Bit Vector |
ユーザー | e869120 |
提出日時 | 2021-06-26 22:08:00 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 1,789 bytes |
コンパイル時間 | 827 ms |
コンパイル使用メモリ | 80,628 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 12:35:28 |
合計ジャッジ時間 | 3,068 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 3 ms
6,940 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 2 ms
6,944 KB |
testcase_07 | AC | 3 ms
6,940 KB |
testcase_08 | AC | 2 ms
6,944 KB |
testcase_09 | AC | 2 ms
6,940 KB |
testcase_10 | AC | 2 ms
6,940 KB |
testcase_11 | AC | 2 ms
6,940 KB |
testcase_12 | AC | 2 ms
6,944 KB |
testcase_13 | AC | 3 ms
6,940 KB |
testcase_14 | AC | 3 ms
6,940 KB |
testcase_15 | AC | 3 ms
6,944 KB |
testcase_16 | AC | 3 ms
6,940 KB |
testcase_17 | AC | 2 ms
6,940 KB |
testcase_18 | AC | 2 ms
6,944 KB |
testcase_19 | AC | 2 ms
6,944 KB |
testcase_20 | AC | 13 ms
6,940 KB |
testcase_21 | AC | 14 ms
6,944 KB |
testcase_22 | AC | 13 ms
6,940 KB |
testcase_23 | AC | 14 ms
6,944 KB |
testcase_24 | AC | 13 ms
6,944 KB |
testcase_25 | AC | 13 ms
6,940 KB |
testcase_26 | AC | 13 ms
6,944 KB |
testcase_27 | AC | 14 ms
6,940 KB |
testcase_28 | AC | 13 ms
6,944 KB |
testcase_29 | AC | 13 ms
6,944 KB |
testcase_30 | AC | 14 ms
6,940 KB |
testcase_31 | AC | 13 ms
6,940 KB |
testcase_32 | AC | 13 ms
6,940 KB |
testcase_33 | AC | 14 ms
6,940 KB |
testcase_34 | AC | 13 ms
6,940 KB |
testcase_35 | AC | 2 ms
6,940 KB |
ソースコード
#include <iostream> #include <vector> #include <string> #include <tuple> using namespace std; int N, K, T; int B[1009], C[1009][1009]; vector<tuple<string, int, int, int>> Answer; void Solve(int px, int py) { Answer.push_back(make_tuple("UPD", N, 1, -1)); Answer.push_back(make_tuple("XOR", N, py, N)); Answer.push_back(make_tuple("AND", N, px, N)); Answer.push_back(make_tuple("XOR", px, px, N)); Answer.push_back(make_tuple("XOR", py, py, N)); } int main() { // Step #1. Input cin >> N >> K >> T; for (int i = 1; i <= T; i++) { for (int j = 0; j < N; j++) cin >> C[i][j]; } // Step #2. Solve for (int i = N - 2; i >= 0; i--) { for (int j = 0; j <= i; j++) { Solve(j, j + 1); } } Answer.push_back(make_tuple("UPD", N, 0, -1)); Answer.push_back(make_tuple("XOR", N, N - K, N)); // Step #3. Output The Answer cout << Answer.size() << endl; for (int i = 0; i < Answer.size(); i++) { if (get<0>(Answer[i]) == "UPD") cout << get<0>(Answer[i]) << " " << get<1>(Answer[i]) << " " << get<2>(Answer[i]) << endl; if (get<0>(Answer[i]) == "AND") cout << get<0>(Answer[i]) << " " << get<1>(Answer[i]) << " " << get<2>(Answer[i]) << " " << get<3>(Answer[i]) << endl; if (get<0>(Answer[i]) == "XOR") cout << get<0>(Answer[i]) << " " << get<1>(Answer[i]) << " " << get<2>(Answer[i]) << " " << get<3>(Answer[i]) << endl; } /*for (int i = 1; i <= T; i++) { for (int j = 0; j < N; j++) B[j] = C[i][j]; B[N] = 0; for (int j = 0; j < Answer.size(); j++) { if (get<0>(Answer[j]) == "UPD") B[get<1>(Answer[j])] = get<2>(Answer[j]); if (get<0>(Answer[j]) == "AND") B[get<1>(Answer[j])] = (B[get<2>(Answer[j])] & B[get<3>(Answer[j])]); if (get<0>(Answer[j]) == "XOR") B[get<1>(Answer[j])] = (B[get<2>(Answer[j])] ^ B[get<3>(Answer[j])]); } }*/ return 0; }