結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 12:13:02
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 5,276 KB
実行使用メモリ 13,676 KB
最終ジャッジ日時 2023-10-12 02:38:48
合計ジャッジ時間 2,030 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,668 KB
testcase_01 AC 19 ms
11,680 KB
testcase_02 AC 19 ms
11,704 KB
testcase_03 AC 19 ms
11,744 KB
testcase_04 AC 19 ms
11,684 KB
testcase_05 AC 18 ms
11,856 KB
testcase_06 AC 19 ms
11,896 KB
testcase_07 AC 18 ms
11,892 KB
testcase_08 AC 19 ms
11,852 KB
testcase_09 AC 19 ms
11,672 KB
testcase_10 AC 19 ms
11,768 KB
testcase_11 AC 19 ms
11,900 KB
testcase_12 AC 19 ms
11,776 KB
testcase_13 AC 19 ms
11,680 KB
testcase_14 AC 18 ms
11,664 KB
testcase_15 AC 19 ms
11,736 KB
testcase_16 AC 19 ms
11,740 KB
testcase_17 AC 19 ms
11,664 KB
testcase_18 AC 19 ms
13,676 KB
testcase_19 AC 19 ms
11,856 KB
testcase_20 AC 19 ms
11,752 KB
testcase_21 AC 18 ms
11,660 KB
testcase_22 AC 19 ms
11,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (calc2 d num bse)
	(if (zero? d)
		(modulo num bse)
		(calc2 (- d 1) (quotient num bse) bse)
	)
)
(define (calc digits expbase bse x n)
	(if (> x n)
		(calc2 (- (- digits 1) (modulo n digits)) (+ expbase (quotient n digits)) bse)
		(calc (+ digits 1) (* expbase bse) bse (* (* (+ digits 1) (* expbase bse)) (- bse 1)) (- n x))
	)
)

(define (ma)
	(let ((n (read)))
		(if (not (eof-object? n)) (begin
			(write (calc 1 1 10 9 (- n 1)))
			(newline)
			(ma)
		))
	)
)

(ma)
0