結果
| 問題 | No.3276 Make Smaller Popcount |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2025-09-20 13:23:22 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 584 bytes |
| 記録 | |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 51,532 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 04:19:45 |
| 合計ジャッジ時間 | 4,352 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | RE * 28 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3276.cc: No.3276 Make Smaller Popcount - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int BN = 30;
/* typedef */
/* global variables */
int bs[BN];
/* subroutines */
/* main */
int main() {
int tn;
scanf("%d", &tn);
while (tn--) {
int n;
scanf("%d", &n);
int k = 0;
for (int i = 0; i < n; i++)
if ((n >> i) & 1) bs[k++] = i;
if (k >= 2) {
int x = (1 << bs[1]) - (1 << bs[0]);
printf("%d\n", x);
}
else
puts("-1");
}
return 0;
}
tnakao0123