結果
| 問題 |
No.2393 Bit Grid Connected Component
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-04 23:30:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 71,040 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 21:44:47 |
| 合計ジャッジ時間 | 2,272 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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++)
ll solve(ll x,ll y){
while(x > 0){
if (x % 2 == 1)y++;
x /= 2;
}
return pow(2,y) - 1;
}
int main(){
int T;
cin >> T;
ll results[T];
rep(i,T){
ll x,y;
cin >> x >> y;
results[i] = solve(x,y);
}
rep(i,T){
cout << results[i] << endl;
}
}