結果

問題 No.887 Collatz
ユーザー varrho
提出日時 2019-09-20 21:27:45
言語 Nim
(2.2.0)
結果
RE  
実行時間 -
コード長 198 bytes
コンパイル時間 4,166 ms
コンパイル使用メモリ 64,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 16:19:40
合計ジャッジ時間 4,511 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 RE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'math' [UnusedImport]

ソースコード

diff #

import math, strutils
var
  tmp: int = stdin.readline.parseInt
  n: seq[int]
while tmp != 1:
  n.add(tmp)
  if tmp mod 2 == 0:
    tmp = tmp div 2
  else:
    tmp = 3 * tmp + 1
echo n.len
echo n.max
0