結果

問題 No.21 平均の差
ユーザー MiyamonYMiyamonY
提出日時 2019-09-03 01:59:07
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 272 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 11,908 KB
最終ジャッジ日時 2023-08-23 07:50:35
合計ジャッジ時間 1,067 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,664 KB
testcase_01 AC 17 ms
11,904 KB
testcase_02 AC 17 ms
11,668 KB
testcase_03 AC 19 ms
11,780 KB
testcase_04 AC 18 ms
11,908 KB
testcase_05 AC 17 ms
11,768 KB
testcase_06 AC 17 ms
11,748 KB
testcase_07 AC 17 ms
11,652 KB
testcase_08 AC 17 ms
11,660 KB
testcase_09 AC 17 ms
11,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve k arr)
  (define max (last arr))
  (define min (car arr))
  (- max min))

(let* ((n (string->number (read-line)))
       (k (string->number (read-line)))
       (arr (map (lambda (_) (string->number (read-line))) (iota n))))
  (print (solve k (sort arr))))
0