結果
問題 | No.2393 Bit Grid Connected Component |
ユーザー |
![]() |
提出日時 | 2023-07-28 21:26:32 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 163 ms / 2,000 ms |
コード長 | 459 bytes |
コンパイル時間 | 2,794 ms |
コンパイル使用メモリ | 243,644 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 17:33:42 |
合計ジャッジ時間 | 4,452 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 20 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);ll t;cin>>t;while(t--){ll x,y;cin>>x>>y;ll ans = 0;ll ni = y;while(ni<60){if(~x>>ni&1) break;ni++;}ni--;while(ni>=0){ans += 1ll<<ni;ni--;}cout<<ans<<endl;}}