結果
| 問題 |
No.862 XORでX
|
| コンテスト | |
| ユーザー |
Cinnamoroll
|
| 提出日時 | 2019-08-09 21:37:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 5,765 bytes |
| コンパイル時間 | 1,546 ms |
| コンパイル使用メモリ | 166,944 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 11:30:26 |
| 合計ジャッジ時間 | 5,723 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 1 WA * 27 |
ソースコード
// 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;
}
Cinnamoroll