結果
| 問題 | No.262 面白くないビットすごろく |
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-08-01 00:07:21 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 292 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 40,640 KB |
| 実行使用メモリ | 48,480 KB |
| 最終ジャッジ日時 | 2026-04-01 15:26:47 |
| 合計ジャッジ時間 | 3,585 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 2 |
ソースコード
// 絶対TLEする
#include <stdio.h>
int bc(long long int a) {
int c = 0;
while(a) {
c += a % 2;
a /= 2;
}
return c;
}
int main(void) {
long long int n, p = 1, c = 1;
scanf("%lld", &n);
while(p < n) {
p += bc(p);
c++;
}
printf("%lld\n", (p == n) ? c : -1 );
return 0;
}
FF256grhy