Submission #29927073
Source Code Expand
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)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Collatz Problem |
| User | Pro_ktmr |
| Language | PyPy3 (7.3.0) |
| Score | 200 |
| Code Size | 191 Byte |
| Status | AC |
| Exec Time | 69 ms |
| Memory | 69304 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 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 |