結果
問題 |
No.822 Bitwise AND
|
ユーザー |
![]() |
提出日時 | 2019-04-26 21:42:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 1,738 ms |
コンパイル使用メモリ | 191,888 KB |
最終ジャッジ日時 | 2025-01-07 03:06:54 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 << 1; i++) { for (int j = i; j <= i + k; j++) { if ((i & j) == n) { cnt++; } } } cout << cnt << endl; }