結果

問題 No.822 Bitwise AND
ユーザー tomatoma
提出日時 2019-04-26 21:40:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 707 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 165,936 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 21:45:41
合計ジャッジ時間 2,724 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 107 ms
5,376 KB
testcase_05 AC 44 ms
5,376 KB
testcase_06 AC 76 ms
5,376 KB
testcase_07 AC 107 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 61 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include"bits/stdc++.h"

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



int main()
{
	ll N, K, res = 0, cnt = 0;
	cin >> N >> K;
	REP(x, N * 4)FOR(y, x, x + K + 1) {
		if ((x&y) == N) {
			//cerr << x << " " << y << endl;
			res++;
		}
	}
	if (N == 0) {
		cout << (K == 0 ? "1" : "INF") << endl;
	}
	else {
		cout << res << endl;
	}


	return 0;
}
0