結果

問題 No.232 めぐるはめぐる (2)
ユーザー matsu7874matsu7874
提出日時 2015-12-27 17:36:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 11,860 KB
実行使用メモリ 10,216 KB
最終ジャッジ日時 2023-10-19 11:16:09
合計ジャッジ時間 7,301 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 30 ms
10,084 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 30 ms
10,084 KB
testcase_08 WA -
testcase_09 AC 30 ms
10,084 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 30 ms
10,084 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T, A, B = map(int, input().split())
if A <= T and B <= T:
    print('YES')
else:
    print('NO')
    exit()

x = 0
y = 0
t = 0

while t < T:
    dy = A - y
    dx = B - x
    dt = T - t

    t += 1
    s = ''

    if dy > 0 or (dy == 0 and (dy - dt) % 2 == 0):
        s += '^'
        y += 1
    elif dy < 0:
        s += 'v'
        y -= 1

    if dx > 0 or (dx == 0 and (dx - dt) % 2 == 0):
        s += '>'
        x += 1
    elif dx < 0:
        s += '<'
        x -= 1

    if s == '':
        s += '>'
        x += 1

    print(s, (y, x))
0