結果

問題 No.706 多眼生物の調査
コンテスト
ユーザー Common Lisp
提出日時 2024-11-16 03:28:26
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 578 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,319 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 26,752 KB
最終ジャッジ日時 2026-05-11 07:28:01
合計ジャッジ時間 2,099 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 MAY 2026 07:27:58 AM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.039

ソースコード

diff #
raw source code

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((n (read))
         (hashmap (make-hash-table))
         (max-val 0)
         (res 0))
    (dotimes (i n)
      (let* ((s (read-line))
             (len-s (length s)))
        (setf (gethash len-s hashmap 0) (+ (gethash len-s hashmap 0) 1))))
    (maphash (lambda (key val)
               (when (or (> val max-val)
                         (and (= val max-val) (> key res)))
                     (setf max-val val
                           res key)))
             hashmap)
    (format t "~d~%" (- res 2))))

(main)
0