結果

問題 No.499 7進数変換
ユーザー toshiro_yanagi
提出日時 2018-06-11 17:10:15
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 188 bytes
コンパイル時間 2,993 ms
コンパイル使用メモリ 64,792 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-30 13:37:54
合計ジャッジ時間 3,582 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'math' [UnusedImport]

ソースコード

diff #

import strutils, math

const
  sv = 7
let
  N = stdin.readLine.parseInt
var
  n = N
  ans = ""

while n != 0:
  ans.insert (n mod sv).repr
  n = n div sv


echo [ans, "0"][int(ans == "")]
0