結果

問題 No.1589 Bit Vector
コンテスト
ユーザー SSRS
提出日時 2021-07-08 23:40:40
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 733 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,086 ms
コンパイル使用メモリ 193,084 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-22 14:51:13
合計ジャッジ時間 5,992 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 2 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, K;
  cin >> N >> K;
  vector<tuple<string, int, int, int>> op;
  for (int i = 0; i < N; i++){
    for (int j = N - 2; j >= i; j--){
      int a = j, b = j + 1;
      op.push_back(make_tuple("XOR", N, a, b));
      op.push_back(make_tuple("AND", b, a, b));
      op.push_back(make_tuple("XOR", a, b, N));
    }
  }
  int cnt = op.size();
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++){
    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;
    }
  }
}
0