結果
問題 |
No.2561 みんな大好きmod 998
|
ユーザー |
![]() |
提出日時 | 2024-11-05 21:09:54 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 588 bytes |
コンパイル時間 | 364 ms |
コンパイル使用メモリ | 35,644 KB |
実行使用メモリ | 37,084 KB |
最終ジャッジ日時 | 2024-11-05 21:10:01 |
合計ジャッジ時間 | 6,224 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | TLE * 1 -- * 43 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 05 NOV 2024 09:09:54 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.009
ソースコード
(defconstant +mod998+ 998) (defconstant +mod9982+ 998244353) (defun dfs (a b c d arr res) (when (zerop c) (when (<= (mod d +mod9982+) (mod d +mod998+)) (incf res))) (when (< a b) (incf d (aref arr a)) (dfs (1+ a) b (1- c) d arr res) (decf d (aref arr a)) (dfs (1+ a) b c d arr res))) (defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (read)) (a (make-array n)) (res 0)) (dotimes (i n) (setf (aref a i) (read))) (dfs 0 n k 0 a res) (format t "~d~%" res))) (main)