結果
問題 | No.48 ロボットの操縦 |
ユーザー | go_boardwalk |
提出日時 | 2017-04-01 01:33:33 |
言語 | Scheme (Gauche-0.9.14) |
結果 |
TLE
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 66 ms |
コンパイル使用メモリ | 5,332 KB |
実行使用メモリ | 11,872 KB |
最終ジャッジ日時 | 2023-09-21 21:52:54 |
合計ジャッジ時間 | 7,246 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 18 ms
11,840 KB |
testcase_01 | AC | 18 ms
11,872 KB |
testcase_02 | AC | 18 ms
11,664 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
ソースコード
(define x (read)) (define y (read)) (define l (read)) (define turn (lambda (x y) (cond ((and (zero? x) (>= y 0)) 0) ((and (>= y 0)) 1) (else 2)))) (print (let loop ((X (abs x)) (Y (abs y)) (L l) (cnt (turn x y))) (cond ((> X 0) (loop (- X L) Y L (+ cnt 1))) ((> Y 0) (loop X (- Y L) L (+ cnt 1))) (else cnt))))