結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 13:15:45
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 12,356 ms
コンパイル使用メモリ 429,032 KB
実行使用メモリ 55,352 KB
最終ジャッジ日時 2024-04-30 19:38:40
合計ジャッジ時間 19,020 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 321 ms
55,128 KB
testcase_01 AC 316 ms
55,232 KB
testcase_02 AC 329 ms
55,156 KB
testcase_03 AC 316 ms
55,116 KB
testcase_04 AC 323 ms
55,328 KB
testcase_05 AC 328 ms
55,280 KB
testcase_06 AC 332 ms
55,216 KB
testcase_07 AC 329 ms
55,152 KB
testcase_08 AC 329 ms
55,252 KB
testcase_09 AC 332 ms
55,200 KB
testcase_10 AC 334 ms
55,116 KB
testcase_11 AC 326 ms
55,252 KB
testcase_12 AC 327 ms
55,204 KB
testcase_13 AC 332 ms
55,260 KB
testcase_14 AC 327 ms
55,284 KB
testcase_15 AC 326 ms
55,272 KB
testcase_16 AC 327 ms
55,264 KB
testcase_17 AC 321 ms
55,272 KB
testcase_18 AC 329 ms
55,352 KB
testcase_19 AC 327 ms
55,256 KB
testcase_20 AC 329 ms
55,220 KB
testcase_21 AC 326 ms
55,292 KB
testcase_22 AC 328 ms
55,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
         ^

ソースコード

diff #

import java.util.*
fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
	val starting:Long=1
	val bse:Long=10
	while(cin.hasNext()){
		var n=cin.nextLong()
		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)
	}
}
0