結果

問題 No.862 XORでX
ユーザー cotton_fn_cotton_fn_
提出日時 2019-08-09 22:57:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,494 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 113,120 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-26 21:33:45
合計ジャッジ時間 5,730 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 8 ms
4,376 KB
testcase_18 AC 8 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 9 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n, x;
int main() {
  cin >> n >> x;
  vector<i64> res;
  i64 cnt = 0;
  for (i64 i = 4; cnt < n - 4; i += 4, cnt += 4) {
    if (i <= x && x < i + 4) continue;
    for (i64 j = 0; j < 4; ++j) res.push_back(i + j);
  }
  i64 d = n - cnt;
  if (d == 1) {
    res.push_back(x);
  } else if (d == 2) {
    res.push_back(x ^ 1);
    res.push_back(1);
  } else if (d == 3) {
    res.push_back(x ^ 3);
    res.push_back(1);
    res.push_back(2);
  } else if (d == 4) {
    res.push_back(x);
    res.push_back(1);
    res.push_back(2);
    res.push_back(3);
  }

  for (i64 a : res) cout << a << '\n';
  return 0;
}
0