結果
問題 |
No.262 面白くないビットすごろく
|
ユーザー |
![]() |
提出日時 | 2015-08-01 00:07:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 292 bytes |
コンパイル時間 | 128 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-07-18 00:10:22 |
合計ジャッジ時間 | 3,493 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 TLE * 1 -- * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lld", &n); | ~~~~~^~~~~~~~~~~~
ソースコード
// 絶対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; }