結果

問題 No.757 チャンパーノウン定数 (2)
ユーザー cielciel
提出日時 2018-12-02 01:53:46
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 292 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 11,420 KB
実行使用メモリ 134,348 KB
最終ジャッジ日時 2023-09-09 13:32:35
合計ジャッジ時間 19,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,248 KB
testcase_01 AC 85 ms
15,272 KB
testcase_02 AC 82 ms
15,000 KB
testcase_03 AC 85 ms
15,268 KB
testcase_04 AC 82 ms
15,000 KB
testcase_05 AC 82 ms
15,124 KB
testcase_06 AC 86 ms
15,132 KB
testcase_07 AC 83 ms
15,072 KB
testcase_08 AC 82 ms
15,144 KB
testcase_09 AC 83 ms
15,124 KB
testcase_10 AC 85 ms
15,204 KB
testcase_11 AC 82 ms
15,280 KB
testcase_12 AC 84 ms
15,100 KB
testcase_13 AC 83 ms
15,128 KB
testcase_14 AC 84 ms
15,228 KB
testcase_15 AC 81 ms
15,160 KB
testcase_16 AC 84 ms
15,020 KB
testcase_17 AC 83 ms
15,200 KB
testcase_18 AC 81 ms
15,024 KB
testcase_19 AC 81 ms
15,332 KB
testcase_20 AC 81 ms
15,228 KB
testcase_21 AC 83 ms
15,212 KB
testcase_22 AC 80 ms
15,092 KB
testcase_23 AC 80 ms
15,292 KB
testcase_24 AC 80 ms
15,116 KB
testcase_25 AC 84 ms
15,120 KB
testcase_26 AC 81 ms
15,092 KB
testcase_27 AC 83 ms
15,096 KB
testcase_28 TLE -
testcase_29 AC 1,585 ms
134,348 KB
testcase_30 AC 92 ms
22,964 KB
testcase_31 AC 128 ms
36,800 KB
testcase_32 AC 81 ms
15,680 KB
testcase_33 AC 161 ms
36,560 KB
testcase_34 AC 582 ms
114,904 KB
testcase_35 AC 114 ms
32,104 KB
testcase_36 AC 101 ms
25,440 KB
testcase_37 AC 1,371 ms
123,752 KB
testcase_38 AC 1,761 ms
127,576 KB
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 AC 970 ms
96,628 KB
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 AC 1,618 ms
113,104 KB
testcase_47 TLE -
testcase_48 AC 1,640 ms
113,244 KB
testcase_49 TLE -
testcase_50 AC 80 ms
15,328 KB
testcase_51 AC 80 ms
15,360 KB
testcase_52 AC 80 ms
15,236 KB
testcase_53 AC 85 ms
15,140 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

starting=1
bse=gets.to_i
while gets
	n=$_.to_i(bse)
	n+=starting-2
	digits=1
	expbase=1
	while (x=expbase*(digits*(bse-1)))<=n
		n-=x
		digits+=1
		expbase*=bse
	end
	num=expbase+n/digits
	#d=digits-1-n%digits
	#d.times{num/=bse}
	#puts num%bse
	puts num.to_s(bse)[-(digits-1-n%digits)-1]
end
0