結果
| 問題 |
No.161 制限ジャンケン
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-11 18:16:23 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 572 bytes |
| コンパイル時間 | 505 ms |
| コンパイル使用メモリ | 36,908 KB |
| 実行使用メモリ | 29,884 KB |
| 最終ジャッジ日時 | 2024-11-11 18:16:26 |
| 合計ジャッジ時間 | 2,035 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 13 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 NOV 2024 06:16:23 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.010
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((g (read))
(c (read))
(p (read))
(s (read-line))
(gg (count #\G s))
(cc (count #\C s))
(pp (count #\P s))
(res 0))
(incf res (* 3 (+ (min g cc) (min c pp) (min p gg))))
(setf g (- g (min g cc))
cc (- cc (min g cc)))
(setf c (- c (min c pp))
pp (- pp (min c pp)))
(setf p (- p (min p gg))
gg (- gg (min p gg)))
(incf res (+ (min g gg) (min c cc) (min p pp)))
(format t "~d~%" res)))
(main)
Common Lisp