結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー |
![]() |
提出日時 | 2024-11-05 22:15:01 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 622 bytes |
コンパイル時間 | 377 ms |
コンパイル使用メモリ | 33,752 KB |
実行使用メモリ | 47,564 KB |
最終ジャッジ日時 | 2024-11-05 22:15:07 |
合計ジャッジ時間 | 6,300 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 43 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 05 NOV 2024 10:15:01 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.010
ソースコード
(defun main (&rest argv)(declare (ignorable argv))(let* ((n (read))(k (read))(a (make-array n))(m1 998244353)(m2 998)(res 0))(dotimes (i n) (setf (aref a i) (read)))(labels ((f (p q r)(when (= (length p) k)(when (<= (mod r m1) (mod r m2))(incf res)))(loop for i from q below n do(push (aref a i) p)(f p (1+ i) (+ r (aref a i)))(pop p))))(f nil 0 0))(format t "~d~%" (mod res m2))))(main)