結果

問題 No.63 ポッキーゲーム
ユーザー nohopennohopen
提出日時 2019-02-11 20:00:29
言語 Scheme
(Gauche-0.9.13)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 5,232 KB
実行使用メモリ 11,916 KB
最終ジャッジ日時 2023-09-26 10:25:31
合計ジャッジ時間 2,048 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,708 KB
testcase_01 AC 19 ms
11,712 KB
testcase_02 AC 19 ms
11,708 KB
testcase_03 AC 19 ms
11,904 KB
testcase_04 AC 19 ms
11,916 KB
testcase_05 AC 19 ms
11,624 KB
testcase_06 AC 19 ms
11,872 KB
testcase_07 AC 18 ms
11,696 KB
testcase_08 AC 19 ms
11,712 KB
testcase_09 AC 17 ms
11,612 KB
testcase_10 AC 18 ms
11,796 KB
testcase_11 AC 19 ms
11,656 KB
testcase_12 AC 19 ms
11,860 KB
testcase_13 AC 18 ms
11,620 KB
testcase_14 AC 19 ms
11,656 KB
testcase_15 AC 19 ms
11,860 KB
testcase_16 AC 18 ms
11,608 KB
testcase_17 AC 18 ms
11,700 KB
testcase_18 AC 19 ms
11,708 KB
testcase_19 AC 18 ms
11,628 KB
testcase_20 AC 19 ms
11,800 KB
testcase_21 AC 18 ms
11,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (poky L K)
  (let* ((n (quotient L 2)))
    (cond [(= L 1) 0]
          [(odd? L) (* (quotient n K) K)]
          [(= (remainder n K) 0) (* (- (quotient n K) 1) K)]
          [else (* (quotient n K) K)])))

(define (main args)
  (let* ((L (read))
         (K (read)))
    (print (poky L K))) 0)
0