結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 13:06:38
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 5,053 ms
コンパイル使用メモリ 67,768 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-13 21:15:08
合計ジャッジ時間 3,930 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#[
/usr/bin/env nim c --nimcache:$HOME/.nimcache --opt:speed --run $0 $@;exit
#]#
import strutils
var starting=5
var bse=10
var s=""
while stdin.readLine(s):
 var n=parseBiggestInt(s)
 n=n+starting-2
 var digits:int64=1
 var expbase:int64=1
 var x:int64=bse-1
 while x<=n:
  n=n-x
  digits=digits+1
  expbase=expbase*bse
  x=digits*expbase*(bse-1)
 var num=expbase+n div digits
 var d=digits-1-n mod digits
 while d>0:
  num=num div bse
  d=d-1
 echo(num mod bse)
0