結果
| 問題 |
No.822 Bitwise AND
|
| コンテスト | |
| ユーザー |
xuzijian629
|
| 提出日時 | 2019-04-26 21:42:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 495 bytes |
| コンパイル時間 | 2,096 ms |
| コンパイル使用メモリ | 192,584 KB |
| 最終ジャッジ日時 | 2025-01-07 03:07:07 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
if (k == 0) {
cout << 1 << endl;
return 0;
}
if (n <= k) {
cout << "INF" << endl;
return 0;
}
int cnt = 0;
for (int i = 0; i <= n << 2; i++) {
for (int j = i; j <= i + k; j++) {
if ((i & j) == n) {
cnt++;
}
}
}
cout << cnt << endl;
}
xuzijian629