結果

問題 No.51 やる気の問題
ユーザー MiyamonYMiyamonY
提出日時 2019-09-07 02:27:42
言語 Scheme
(Gauche-0.9.14)
結果
TLE  
実行時間 -
コード長 370 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 18,600 KB
最終ジャッジ日時 2023-09-07 07:30:41
合計ジャッジ時間 10,399 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
14,100 KB
testcase_01 AC 30 ms
13,952 KB
testcase_02 AC 23 ms
12,644 KB
testcase_03 AC 2,023 ms
14,292 KB
testcase_04 AC 614 ms
14,372 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (read-number)
  (string->number (read-line)))

(define (generate n)
  (define m n)
  (lambda () (let1 k m
	      (set! m (- m 1))
	      k)))

(let* ((w (read-number))
       (d (read-number)))
  (define gen (generate d))

  (print (let loop ((rem w))
	   (let1 n (gen)
		 (cond ((= n 1) rem)
		       (else
			(loop #?=(- rem #?=(div #?=rem #?=(* n n))))))))))
0