結果

問題 No.143 豆
ユーザー MOD9cXWdOsRxvPyMOD9cXWdOsRxvPy
提出日時 2022-10-02 20:32:19
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 311 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 11,920 KB
最終ジャッジ日時 2023-08-26 18:15:27
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,864 KB
testcase_01 AC 18 ms
11,804 KB
testcase_02 AC 18 ms
11,788 KB
testcase_03 AC 18 ms
11,844 KB
testcase_04 AC 18 ms
11,892 KB
testcase_05 AC 18 ms
11,796 KB
testcase_06 AC 19 ms
11,788 KB
testcase_07 AC 18 ms
11,656 KB
testcase_08 AC 18 ms
11,920 KB
testcase_09 AC 19 ms
11,792 KB
testcase_10 AC 18 ms
11,684 KB
testcase_11 AC 18 ms
11,704 KB
testcase_12 AC 18 ms
11,836 KB
testcase_13 AC 19 ms
11,696 KB
testcase_14 AC 19 ms
11,684 KB
testcase_15 AC 19 ms
11,644 KB
testcase_16 AC 18 ms
11,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (str->lst str)
   (map (^x (string->number x))
	(string-split str " "))
  )

(define (main _)
  (let* ([bns (apply * (take (str->lst (read-line)) 2))]
	 [num (apply + (str->lst (read-line)))]
	 [rmng (- bns num)])
    (display (if (negative? rmng) -1 rmng))
    )
  (newline)
  0)

0