結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 12:11:30
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 993 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 8,136 ms
コンパイル使用メモリ 252,628 KB
実行使用メモリ 63,252 KB
最終ジャッジ日時 2023-09-13 21:16:10
合計ジャッジ時間 32,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 965 ms
63,164 KB
testcase_01 AC 977 ms
62,948 KB
testcase_02 AC 970 ms
62,712 KB
testcase_03 AC 978 ms
63,068 KB
testcase_04 AC 971 ms
62,816 KB
testcase_05 AC 977 ms
63,252 KB
testcase_06 AC 982 ms
62,740 KB
testcase_07 AC 993 ms
63,012 KB
testcase_08 AC 992 ms
62,816 KB
testcase_09 AC 979 ms
62,908 KB
testcase_10 AC 985 ms
62,868 KB
testcase_11 AC 982 ms
62,728 KB
testcase_12 AC 985 ms
62,796 KB
testcase_13 AC 984 ms
62,728 KB
testcase_14 AC 983 ms
62,864 KB
testcase_15 AC 975 ms
62,852 KB
testcase_16 AC 975 ms
62,820 KB
testcase_17 AC 983 ms
62,900 KB
testcase_18 AC 977 ms
62,728 KB
testcase_19 AC 970 ms
62,744 KB
testcase_20 AC 965 ms
62,732 KB
testcase_21 AC 971 ms
62,664 KB
testcase_22 AC 967 ms
62,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//usr/bin/env scala $0 $@;exit
object Main{
	def main(args: Array[String]) = {
		val cin=new java.util.Scanner(System.in)
		val starting:Long=1
		val bse=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
			for(i<-1 to (digits-1-n%digits).toInt)num/=bse
			println(num%bse)
		}
	}
}
0