結果
| 問題 | No.2393 Bit Grid Connected Component |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-04 23:30:07 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| 記録 | |
| コンパイル時間 | 644 ms |
| コンパイル使用メモリ | 88,028 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-02 06:45:24 |
| 合計ジャッジ時間 | 2,904 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}