提出 #29927073
ソースコード 拡げる
s = int(input())
appeared = [0] * 1000001
i = 1
while appeared[s] == 0:
appeared[s] = 1
if s % 2 == 0:
s = s // 2
else:
s = 3 * s + 1
i += 1
print(i)
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Collatz Problem |
| ユーザ | Pro_ktmr |
| 言語 | PyPy3 (7.3.0) |
| 得点 | 200 |
| コード長 | 191 Byte |
| 結果 | AC |
| 実行時間 | 69 ms |
| メモリ | 69304 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, s1.txt, s2.txt, s3.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 69 ms | 69132 KiB |
| 02.txt | AC | 54 ms | 69276 KiB |
| 03.txt | AC | 56 ms | 69304 KiB |
| 04.txt | AC | 56 ms | 69068 KiB |
| 05.txt | AC | 55 ms | 69140 KiB |
| 06.txt | AC | 52 ms | 69068 KiB |
| 07.txt | AC | 55 ms | 69160 KiB |
| 08.txt | AC | 58 ms | 69296 KiB |
| 09.txt | AC | 57 ms | 69144 KiB |
| s1.txt | AC | 54 ms | 69016 KiB |
| s2.txt | AC | 56 ms | 68976 KiB |
| s3.txt | AC | 53 ms | 69052 KiB |