結果
| 問題 |
No.3 ビットすごろく
|
| コンテスト | |
| ユーザー |
nyan68682154
|
| 提出日時 | 2019-05-15 08:19:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 509 bytes |
| コンパイル時間 | 552 ms |
| コンパイル使用メモリ | 57,508 KB |
| 実行使用メモリ | 10,140 KB |
| 最終ジャッジ日時 | 2024-09-13 14:22:10 |
| 合計ジャッジ時間 | 11,120 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 29 |
ソースコード
#include<iostream>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<string>
using namespace std;
int main() {
int n;
int masu = 1;
int s = 0;
int k;
cin >> n;
for (int i = 1; i <= 1000000000; i++) {
if (masu == n) {
cout << i ;
break;
}
k = masu;
for (int j = 1; j <= 1000000; j++) {
s = k % 2 + s;
k = k / 2 ;
if (k == 0) {
break;
}
}
masu = s + masu;
if (masu > n) {
masu = masu - s*2;
}
s = 0;
if (i == 100000000) {
cout << -1;
}
}
}
nyan68682154