結果

問題 No.601 Midpoint Erase
ユーザー ducktailducktail
提出日時 2017-12-21 22:38:01
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 5,360 KB
実行使用メモリ 17,396 KB
最終ジャッジ日時 2023-08-24 18:50:51
合計ジャッジ時間 2,904 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,852 KB
testcase_01 AC 18 ms
11,760 KB
testcase_02 AC 18 ms
11,672 KB
testcase_03 AC 115 ms
15,456 KB
testcase_04 AC 126 ms
15,312 KB
testcase_05 AC 95 ms
15,320 KB
testcase_06 AC 63 ms
15,476 KB
testcase_07 AC 123 ms
17,396 KB
testcase_08 AC 107 ms
15,392 KB
testcase_09 AC 126 ms
15,392 KB
testcase_10 AC 42 ms
13,896 KB
testcase_11 AC 169 ms
15,368 KB
testcase_12 AC 88 ms
15,576 KB
testcase_13 AC 17 ms
11,644 KB
testcase_14 AC 17 ms
11,584 KB
testcase_15 AC 17 ms
11,840 KB
testcase_16 AC 17 ms
11,844 KB
testcase_17 AC 17 ms
11,676 KB
testcase_18 AC 17 ms
11,740 KB
testcase_19 AC 16 ms
11,680 KB
testcase_20 AC 16 ms
11,628 KB
testcase_21 AC 16 ms
11,732 KB
testcase_22 AC 18 ms
11,684 KB
testcase_23 AC 17 ms
11,848 KB
testcase_24 AC 17 ms
11,832 KB
testcase_25 AC 17 ms
13,880 KB
権限があれば一括ダウンロードができます

ソースコード

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