結果

問題 No.2815 Smaller than all
ユーザー keiden
提出日時 2024-09-29 19:48:02
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 8,224 KB
実行使用メモリ 22,400 KB
最終ジャッジ日時 2025-06-20 02:17:45
合計ジャッジ時間 6,958 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

(define yuki2815
  (let* ((n (read))
         (ax (make-u32vector n)))
    (dotimes (i n) (u32vector-set! ax i (read)))
    (let loop-right ((r 0))
      (if (and (< (+ r 1) n) (<= (u32vector-ref ax (+ r 1)) (u32vector-ref ax r)))
        (loop-right (+ r 1))
        (let loop-left ((l r))
          (if (and (< 0 l) (equal? (u32vector-ref ax r) (u32vector-ref ax (- l 1))))
            (loop-left (- l 1))
            (print (- (+ r 1) l))))))))
0