結果
問題 |
No.887 Collatz
|
ユーザー |
|
提出日時 | 2025-05-04 01:47:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 215 bytes |
コンパイル時間 | 439 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2025-05-04 01:47:46 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 23 WA * 5 |
ソースコード
def Main(): n=int(input()) ans=1 cnt=0 while n!=1: cnt+=1 if n%2==0: n//=2 else: n=3*n+1 ans=max(ans,n) print(cnt) print(ans) Main()