結果

問題 No.601 Midpoint Erase
ユーザー ducktailducktail
提出日時 2017-12-21 22:38:01
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-12-23 03:33:43
合計ジャッジ時間 3,567 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (read-point n)
  (let loop ([ee 0]
             [eo 0]
             [oe 0]
             [oo 0]
             [c n])
    (if (zero? c)
        (values ee eo oe oo)
        (let* ([x (read)]
               [y (read)])
          (cond [(and (even? x) (even? y)) (loop (+ ee 1) eo oe oo (- c 1))]
                [(and (even? x) (odd? y)) (loop ee (+ eo 1) oe oo (- c 1))]
                [(and (odd? x) (even? y)) (loop ee eo (+ oe 1) oo (- c 1))]
                [else (loop ee eo oe (+ oo 1) (- c 1))])
          ))))

(define (main args)
  (let ([n (read)])
    (print
     (receive
      (ee eo oe oo)
      (read-point n)
      (let ([c (+ (quotient ee 2)
                  (quotient eo 2)
                  (quotient oe 2)
                  (quotient oo 2))])
        (if (odd? c) "Alice" "Bob")))))
  0)
0