結果

問題 No.1228 I hate XOR Matching
ユーザー 👑 kmjpkmjp
提出日時 2020-09-11 22:30:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,090 bytes
コンパイル時間 2,103 ms
コンパイル使用メモリ 200,816 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-27 15:20:53
合計ジャッジ時間 15,866 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int K;
ll X;
int Z;
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>K>>X;
	
	
	if(X==0) {
		cout<<"Yes"<<endl;
		cout<<1<<endl;
		cout<<(K^1)<<endl;
		return;
	}
	
	if(K==0) {
		if(X&(X+1)) {
			cout<<"No"<<endl;
			return;
		}
		X++;
		while(X%2==0) X/=2, Z++;
		cout<<"Yes"<<endl;
		cout<<Z<<endl;
		FOR(i,Z) cout<<0<<" ";
		cout<<endl;
		return;
	}
	assert(0);
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0