結果

問題 No.862 XORでX
ユーザー CinnamorollCinnamoroll
提出日時 2019-08-09 21:37:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 5,765 bytes
コンパイル時間 2,061 ms
コンパイル使用メモリ 165,080 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-26 17:32:07
合計ジャッジ時間 7,453 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
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 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// warm heart, wagging tail,and a smile just for you!
//
//                            ▒█████▒▒
//                             ██████████▒
//                             ▒████████████▒
//                            ██████████████████
//                           ████████████████████▒
//                          ▒██████████████████████▒
//                          ▒███████████████████████
//                      ▒████▒▒▒▒▒▒█████████████████▒
//                    ███▒▒▒▒▒▒██████████████████████▒▒▒
//                  ▒██▒▒███████████████████████▒▒▒▒▒██████
//                 ▒█████████████████████████▒▒▒▒▒▒█████████▒
//                 ▒█████████████████████▒▒▒▒▒▒██████████████
//                  ▒████         ████▒▒▒▒▒████         ████▒
//              ▒█████▒    ████    ▒▒▒▒███████    ████    ██████▒
//            ▒██▒▒▒▒▒    ██████    █████████    ██████    ██▒▒▒██▒
//           █████████   ████████   █████████   ████████   ▒▒▒▒█████
//          ▒█████████    ██████    ████████▒    ██████    █████████
//          ▒██████████    ████    █████▒▒▒▒▒▒    ████    ██████████
//           ████████████        ▒▒▒▒▒▒▒████████        ███████████▒
//       ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒
//     ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒
//   ▒▒▒▒▒▒▒▒▒██████████████                         ███████▒▒▒▒███████████
//   █████████████████████████                     ███████▒▒▒██████████████▒
//   █████████████████████████████             ███████▒▒▒██████████████████▒
//   ██████████████████████████████████████████████████████████████████████
//    ██████████████████████████████████████████████████████████████████▒
//      ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n,x;
  cin >> n >> x;

  if(n%4==0){
    cout << x << "\n" << 1 << '\n';
    int cnt = n-2;
    FOR(i,3,10010){
      if(i != x || i+1 != x){
        cnt-=2;
        cout << i++ << "\n" << i << "\n";
      }
      else i++;
      if(cnt==0) break;
    }
  }

  if(n%4==1){
    cout << x << '\n';
    int cnt = n-1;
    FOR(i,1,10010){
      if(i != x || i+1 != x){
        cnt-=2;
        cout << i++ << "\n" << i << "\n";
      }
      else i++;
      if(cnt==0) break;
    }
  }

  if(n%4==2){
    x ^= 1;
    if(x == 0) x = 2;
    cout << x << "\n" << 1 << '\n';
    int cnt = n-2;
    FOR(i,3,10010){
      if(i != x || i+1 != x){
        cnt-=2;
        cout << i++ << "\n" << i << "\n";
      }
      else i++;
      if(cnt==0) break;
    }
  }


  if(n%4==3){
    x ^= 1;
    if(x == 0){
      cout << 1 << "\n" << 2 << "\n" << 4 << "\n";
      REP(i,n-3) cout << i+5 << "\n";
      return 0;
    }
    cout << x << '\n';
    int cnt = n-1;
    FOR(i,1,10010){
      if(i != x || i+1 != x){
        cnt-=2;
        cout << i++ << "\n" << i << "\n";
      }
      else i++;
      if(cnt==0) break;
    }
  }

  return 0;
}
0