結果

問題 No.756 チャンパーノウン定数 (1)
コンテスト
ユーザー ciel
提出日時 2018-12-06 12:15:37
言語 Clojure(Beta)
(1.12.4)
コンパイル:
true
実行:
clojure -M _filename_
結果
AC  
実行時間 1,672 ms / 2,000 ms
コード長 471 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 152 ms
コンパイル使用メモリ 8,100 KB
実行使用メモリ 82,364 KB
最終ジャッジ日時 2026-05-15 14:15:08
合計ジャッジ時間 40,560 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/clojure

(defn calc2 [d num bse]
	(if (zero? d)
		(rem num bse)
		(recur (- d 1) (quot num bse) bse)
	)
)
(defn calc [digits expbase bse x n]
	(if (> x n)
		(calc2 (- (- digits 1) (rem n digits)) (+ expbase (quot n digits)) bse)
		(recur (+ digits 1) (* expbase bse) bse (* (* (+ digits 1) (* expbase bse)) (- bse 1)) (- n x))
	)
)

(defn ma []
	(let [n (read *in* nil nil)]
		(if (not (= n nil)) (do
			(println (calc 1 1 10 9 (- n 1)))
			(ma)
		))
	)
)
(ma)
0