結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2020-08-23 13:27:29
言語 Crystal
(1.11.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 17,754 ms
コンパイル使用メモリ 253,696 KB
実行使用メモリ 4,428 KB
最終ジャッジ日時 2023-09-13 11:57:14
合計ジャッジ時間 17,701 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/usr/bin/env crystal
lib C;fun strtoll(s: UInt8*,p: UInt8*,b: Int32): Int64;end
starting=1_i64
base=10
while (s=gets)!=nil
	n=C.strtoll(s.not_nil!,nil,10)+starting-2
	digits=1_i64
	expbase=1_i64
	while (x=digits*expbase*(base-1))<=n
		digits+=1
		expbase*=base
		n-=x
	end
	num=expbase+n//digits
	d=digits-1-n%digits
	d.times{num//=base}
	puts num%base
end
0