結果
| 問題 |
No.2561 みんな大好きmod 998
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-05 20:49:59 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 628 bytes |
| コンパイル時間 | 300 ms |
| コンパイル使用メモリ | 33,628 KB |
| 実行使用メモリ | 35,180 KB |
| 最終ジャッジ日時 | 2024-11-05 20:50:05 |
| 合計ジャッジ時間 | 6,613 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 TLE * 1 -- * 42 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 05 NOV 2024 08:49:59 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.011
ソースコード
(defconstant +mod998+ 998)
(defconstant +mod9982+ 998244353)
(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)))
(labels ((f (x y z)
(when (= x k)
(when (<= (mod z +mod9982+) (mod z +mod998+))
(incf res)
(return-from f)))
(loop for i from (1+ y) below n do
(f (1+ x) i (+ z (aref a i))))))
(f 0 -1 0))
(format t "~d~%" (mod res +mod998+))))
(main)
Common Lisp