結果

問題 No.887 Collatz
コンテスト
ユーザー varrho
提出日時 2019-09-20 21:27:45
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 198 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,272 ms
コンパイル使用メモリ 66,956 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-04 13:41:14
合計ジャッジ時間 4,625 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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