結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-08 11:09:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 9,544 ms
コンパイル使用メモリ 433,536 KB
実行使用メモリ 54,400 KB
最終ジャッジ日時 2024-04-30 19:39:10
合計ジャッジ時間 16,365 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
54,120 KB
testcase_01 AC 249 ms
54,172 KB
testcase_02 AC 246 ms
54,144 KB
testcase_03 AC 255 ms
54,140 KB
testcase_04 AC 256 ms
54,164 KB
testcase_05 AC 259 ms
54,184 KB
testcase_06 AC 272 ms
54,400 KB
testcase_07 AC 252 ms
54,220 KB
testcase_08 AC 257 ms
54,040 KB
testcase_09 AC 248 ms
54,152 KB
testcase_10 AC 247 ms
54,180 KB
testcase_11 AC 262 ms
54,152 KB
testcase_12 AC 257 ms
54,140 KB
testcase_13 AC 246 ms
54,252 KB
testcase_14 AC 248 ms
54,236 KB
testcase_15 AC 253 ms
54,044 KB
testcase_16 AC 250 ms
54,124 KB
testcase_17 AC 243 ms
54,232 KB
testcase_18 AC 244 ms
54,264 KB
testcase_19 AC 249 ms
54,148 KB
testcase_20 AC 245 ms
54,272 KB
testcase_21 AC 256 ms
54,224 KB
testcase_22 AC 246 ms
54,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
         ^

ソースコード

diff #

fun main(args: Array<String>){
	val starting:Long=1
	val bse:Long=10
	var s=readLine()
	while(s!=null){
		var n=s.toLong()
		n+=starting-2
		var digits:Long=1
		var expbase:Long=1
		var x:Long=bse-1
		while(x<=n){
			n-=x
			digits+=1
			expbase*=bse
			x=digits*expbase*(bse-1)
		}
		var num=expbase+n/digits
		var d:Long=0
		while(d<digits-1-n%digits){num/=bse;d+=1}
		println(num%bse)
		s=readLine()
	}
}
0