結果
| 問題 | No.3631 Collatz conjecture |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-08-21 21:29:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| + 876µs | |
| コード長 | 172 bytes |
| 記録 | |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 96,624 KB |
| 実行使用メモリ | 79,204 KB |
| 最終ジャッジ日時 | 2026-08-21 21:29:29 |
| 合計ジャッジ時間 | 6,119 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 53 |
ソースコード
N = int(input())
if N == 1:
print(3)
exit()
cnt = 0
while N != 1:
if N % 2 == 0:
N = N // 2
else:
N = 3 * N + 1
cnt += 1
print(cnt)