結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ldsyb
提出日時 2016-05-24 18:03:53
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 6,812 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-06-26 07:55:32
合計ジャッジ時間 2,801 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

(define ans 0)
(define max 0)
(define tmp 0)
(define n (read))
(define l (list))
(let loop((i n))
	(set! l (cons (read) l))
	(if (> i 1) (loop (- i 1))))
(define (countnum ls num retnum)
	(if (pair? ls)
		(countnum (cdr ls) num (if (= (car ls) num) (+ retnum 1) retnum))
		retnum))
(let loop((i 1))
	(set! tmp (countnum l i 0))
	(if (<= max tmp)
		(begin
			(set! ans i)
			(set! max tmp)))
	(if (< i 6) (loop (+ i 1))))
(display ans)
(newline)
0