結果
| 問題 | No.3624 Product |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-08-17 15:42:12 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| + 558µs | |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 50,892 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-17 15:42:15 |
| 合計ジャッジ時間 | 1,873 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3624.cc: No.3624 Product - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
/* typedef */
using ui = unsigned int;
using ull = unsigned long long;
/* global variables */
/* subroutines */
/* main */
int main() {
int tn;
scanf("%d", &tn);
while (tn--) {
ui l, r;
scanf("%u%u", &l, &r);
ui b = 1;
while ((b << 1) <= r) b <<= 1;
ui a = b - 1;
if (l <= a) printf("%llu\n", (ull)a * b);
else puts("-1");
}
return 0;
}
tnakao0123