結果

問題 No.232 めぐるはめぐる (2)
ユーザー matsu7874matsu7874
提出日時 2015-12-27 17:40:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 10,320 KB
最終ジャッジ日時 2023-10-19 11:16:42
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

T, A, B = map(int, input().split())
if T == 1 and A+B>0:
    print('NO')
    exit()
elif 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)
0