結果

問題 No.1355 AND OR GAME
ユーザー tarakojo1019tarakojo1019
提出日時 2021-01-18 11:01:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,448 bytes
コンパイル時間 2,041 ms
コンパイル使用メモリ 115,648 KB
実行使用メモリ 6,876 KB
最終ジャッジ日時 2023-08-20 18:36:06
合計ジャッジ時間 14,004 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 13 ms
4,376 KB
testcase_35 AC 123 ms
6,660 KB
testcase_36 AC 113 ms
6,456 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 123 ms
6,596 KB
testcase_39 AC 43 ms
4,380 KB
testcase_40 AC 60 ms
4,896 KB
testcase_41 AC 124 ms
6,724 KB
testcase_42 AC 123 ms
6,740 KB
testcase_43 AC 71 ms
4,380 KB
testcase_44 AC 19 ms
4,376 KB
testcase_45 AC 126 ms
6,580 KB
testcase_46 AC 47 ms
4,548 KB
testcase_47 AC 127 ms
6,572 KB
testcase_48 AC 92 ms
6,296 KB
testcase_49 AC 126 ms
6,800 KB
testcase_50 WA -
testcase_51 AC 63 ms
4,880 KB
testcase_52 AC 110 ms
6,504 KB
testcase_53 AC 75 ms
5,144 KB
testcase_54 AC 124 ms
6,660 KB
testcase_55 AC 108 ms
4,584 KB
testcase_56 AC 107 ms
4,528 KB
testcase_57 AC 88 ms
6,112 KB
testcase_58 AC 26 ms
4,380 KB
testcase_59 AC 1 ms
4,380 KB
testcase_60 AC 83 ms
6,132 KB
testcase_61 AC 2 ms
4,380 KB
testcase_62 AC 54 ms
4,376 KB
testcase_63 AC 123 ms
6,620 KB
testcase_64 AC 108 ms
4,540 KB
testcase_65 AC 2 ms
4,380 KB
testcase_66 AC 37 ms
4,380 KB
testcase_67 AC 41 ms
4,380 KB
testcase_68 AC 40 ms
4,376 KB
testcase_69 AC 1 ms
4,380 KB
testcase_70 AC 48 ms
4,696 KB
testcase_71 AC 130 ms
6,632 KB
testcase_72 AC 128 ms
6,740 KB
testcase_73 AC 125 ms
6,628 KB
testcase_74 AC 124 ms
6,580 KB
testcase_75 AC 123 ms
6,740 KB
testcase_76 AC 122 ms
6,876 KB
testcase_77 AC 123 ms
6,628 KB
testcase_78 AC 2 ms
4,380 KB
testcase_79 AC 1 ms
4,380 KB
testcase_80 AC 122 ms
6,588 KB
testcase_81 AC 122 ms
6,592 KB
testcase_82 AC 126 ms
6,752 KB
testcase_83 AC 106 ms
4,648 KB
testcase_84 AC 22 ms
4,380 KB
testcase_85 WA -
testcase_86 WA -
testcase_87 WA -
testcase_88 AC 4 ms
4,376 KB
testcase_89 WA -
testcase_90 WA -
testcase_91 AC 9 ms
4,380 KB
testcase_92 WA -
testcase_93 AC 54 ms
6,280 KB
testcase_94 AC 35 ms
4,760 KB
testcase_95 AC 24 ms
4,600 KB
testcase_96 AC 18 ms
4,376 KB
testcase_97 AC 4 ms
4,380 KB
testcase_98 AC 65 ms
6,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<functional>
#include<string>
#include<numeric>
#include<cstring>
#include<random>
#include<array>
#include<fstream>
#include<iomanip>
#include<list>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<queue>

/*
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

using namespace std;

using ll = long long;
using ull = unsigned long long;

#define REP(i,a,b) for(ll i = a; i < b; ++i)
#define PRI(s) std::cout << s << endl
#define PRIF(v, n) printf("%."#n"f\n", (double)v)

template<typename A, typename B>void mins(A& a, const B& b) { a = min(a, (A)b); };
template<typename A, typename B>void maxs(A& a, const B& b) { a = max(a, (A)b); };



int main() {
	ll N, X, Y; cin >> N >> X >> Y;
	vector<ll> A(N+1);
	vector<ll> P;
	A[0] = X;
	REP(i, 1, N+1) cin >> A[i];
	reverse(A.begin(), A.end());
	ll a = Y;
	ll b = ~Y;
	REP(i, 0, N) {
		if ((~A[i] & a) == 0) {
			if ((b & A[i]) == 0) {
				P.push_back(3);
				while (P.size() != N) P.push_back(1);
				reverse(P.begin(), P.end());
				for (ll p : P) cout << p << " ";
				cout << endl;
				return 0;
			}

			b = b & A[i];
			P.push_back(1);
		}
		else if ((b & A[i]) == 0) {
			a = a & ~A[i];
			P.push_back(2);
		}
		else {
			PRI(-1);
			return 0;
		}
	}
	PRI(-1);
	return 0;
}
0