結果
問題 |
No.2393 Bit Grid Connected Component
|
ユーザー |
|
提出日時 | 2023-08-04 23:23:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 405 bytes |
コンパイル時間 | 746 ms |
コンパイル使用メモリ | 70,456 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-14 21:36:48 |
合計ジャッジ時間 | 3,530 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 WA * 16 |
ソースコード
#include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve(ll x,ll y){ while(x > 0){ if (x % 2 == 1)y++; x /= 2; } cout << pow(2,y) - 1 << endl; } int main(){ int T; cin >> T; rep(i,T){ ll x,y; cin >> x >> y; solve(x,y); } }