結果
問題 |
No.822 Bitwise AND
|
ユーザー |
![]() |
提出日時 | 2019-04-26 21:44:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 476 bytes |
コンパイル時間 | 2,004 ms |
コンパイル使用メモリ | 192,724 KB |
最終ジャッジ日時 | 2025-01-07 03:07:38 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 4 |
ソースコード
#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; } 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; }