結果

問題 No.894 二種類のバス
ユーザー MiyamonYMiyamonY
提出日時 2019-09-28 19:56:22
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 758 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 7,076 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-04-14 07:00:22
合計ジャッジ時間 1,525 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
15,872 KB
testcase_01 AC 24 ms
15,872 KB
testcase_02 AC 25 ms
16,000 KB
testcase_03 AC 25 ms
15,872 KB
testcase_04 AC 24 ms
16,000 KB
testcase_05 AC 24 ms
16,000 KB
testcase_06 AC 24 ms
16,000 KB
testcase_07 AC 24 ms
16,000 KB
testcase_08 AC 24 ms
16,000 KB
testcase_09 AC 24 ms
16,000 KB
testcase_10 AC 24 ms
16,128 KB
testcase_11 AC 24 ms
15,872 KB
testcase_12 AC 24 ms
16,128 KB
testcase_13 AC 24 ms
15,872 KB
testcase_14 AC 24 ms
15,872 KB
testcase_15 AC 24 ms
15,872 KB
testcase_16 AC 24 ms
16,000 KB
testcase_17 AC 24 ms
16,000 KB
testcase_18 AC 24 ms
16,000 KB
testcase_19 AC 23 ms
15,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

;;; File:  main.scm
;; Author: ymiyamoto
;;
;; Created on Sat Sep 28 19:45:12 2019
;;
(define-syntax read-number
  (syntax-rules ()
    ((_ nums)
     (define-values nums
       (apply values (map string->number (string-split (read-line) #\space)))))))

(define-syntax read-numbers
  (syntax-rules ()
    ((_ as)
     (define as (map string->number (string-split (read-line) #\space))))
    ((_ as n)
     (define as (map (lambda (_) (map string->number (string-split (read-line) #\space))) (iota n))))))

(define-syntax 1+ (syntax-rules () ((_ x) (+ x 1))))

(define-syntax 1- (syntax-rules () ((_ x) (- x 1))))

(define (solve)
  (read-number (t a b))

  (print (- (+ (ceiling (/ t a))
	       (ceiling (/ t b)))
	    (ceiling (/ t (lcm a b))))))

(solve)
0