結果

問題 No.1589 Bit Vector
ユーザー SSRS
提出日時 2021-07-08 23:40:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 733 bytes
コンパイル時間 1,688 ms
コンパイル使用メモリ 176,276 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-07-01 13:18:04
合計ジャッジ時間 8,938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 2 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#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