結果

問題 No.750 Frac #1
ユーザー ldsybldsyb
提出日時 2019-09-19 03:46:43
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 1,000 ms
コード長 349 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 11,948 KB
最終ジャッジ日時 2023-09-25 08:17:04
合計ジャッジ時間 2,497 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,784 KB
testcase_01 AC 19 ms
11,760 KB
testcase_02 AC 19 ms
11,776 KB
testcase_03 AC 18 ms
11,648 KB
testcase_04 AC 19 ms
11,856 KB
testcase_05 AC 19 ms
11,884 KB
testcase_06 AC 19 ms
11,888 KB
testcase_07 AC 19 ms
11,948 KB
testcase_08 AC 18 ms
11,780 KB
testcase_09 AC 18 ms
11,776 KB
testcase_10 AC 20 ms
11,664 KB
testcase_11 AC 19 ms
11,684 KB
testcase_12 AC 19 ms
11,908 KB
testcase_13 AC 19 ms
11,768 KB
testcase_14 AC 18 ms
11,660 KB
testcase_15 AC 19 ms
11,880 KB
testcase_16 AC 19 ms
11,892 KB
testcase_17 AC 18 ms
11,900 KB
testcase_18 AC 18 ms
11,648 KB
testcase_19 AC 18 ms
11,760 KB
testcase_20 AC 18 ms
11,860 KB
testcase_21 AC 19 ms
11,648 KB
testcase_22 AC 18 ms
11,900 KB
testcase_23 AC 18 ms
11,736 KB
testcase_24 AC 18 ms
11,652 KB
testcase_25 AC 18 ms
11,896 KB
testcase_26 AC 19 ms
11,872 KB
testcase_27 AC 19 ms
11,772 KB
testcase_28 AC 20 ms
11,652 KB
testcase_29 AC 18 ms
11,884 KB
testcase_30 AC 19 ms
11,888 KB
testcase_31 AC 18 ms
11,664 KB
testcase_32 AC 18 ms
11,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define n (read))
(define a '())
(let loop((i 0))
	(if (= i n)
		'()
		(begin
			(let ((p (read)) (q (read)))
				(set! a (cons (cons p q) a))
			)
			(loop (+ i 1))
		)
	)
)

(set! a
	(sort a
		(lambda (x y)
			(let ((p (/ (car x) (cdr x))) (q (/ (car y) (cdr y))))
				(> p q)
			)
		)
	)
)

(for-each (lambda (x)
	(print (car x) " " (cdr x))
)
a)
0