結果

問題 No.1721 [Cherry 3rd Tune N] 麗しきNumber
ユーザー norioc
提出日時 2025-06-22 23:47:07
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 1,459 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 8,356 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2025-06-22 23:47:12
合計ジャッジ時間 4,548 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

(use scheme.list)
(use util.match)
(use srfi.13) ; string
(use srfi.42) ; list-ec

(define input read-line)

(define (ii)
  (string->number (read-line)))

(define (li)
  (let ((s (read-line)))
    (map string->number (string-split s " "))))

(define (prn . args)
  (for-each (lambda (i x)
              (when (> i 0)
                (display " "))
              (display x))
            (iota (length args))
            args)
  (newline))

(define int string->number)

(define-method min ((xs <sequence>))
  (apply min xs))

(define (minmax . xs) (apply min&max xs))
(define-method minmax ((xs <sequence>)) (apply min&max xs))

(define (sum xs) (apply + xs))

(define divmod div-and-mod)

(define pow
  (case-lambda
   ((a b) (expt a b))
   ((a b m) (expt-mod a b m))))

(define (yn b)
  (prn (if b "Yes" "No")))

(define-macro (input! bindings . body)
  (let loop ((bs (reverse bindings))
             (res '()))
    (if (null? bs)
        `(let*-values ,res
           ,@body)
        (cond
         ((symbol? (car bs))
          (loop (cdr bs)
                (cons `((,(car bs)) (values (ii)))
                      res)))
         ((list? (car bs))
          (loop (cdr bs)
                (cons `(,(car bs) (apply values (li)))
                      res)))
         (else
          'error)))))

(let ((S (input)))
  (let ((cs (string->list S)))
    (if (and (member #\4 cs)
             (member #\6 cs))
        (prn "Beautiful")
        (prn "..."))))
0