結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-01-31 17:53:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,330 bytes |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 82,588 KB |
| 実行使用メモリ | 76,476 KB |
| 最終ジャッジ日時 | 2024-06-29 02:28:33 |
| 合計ジャッジ時間 | 2,813 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 5 |
ソースコード
t,b,a = map(int,input().split())
if t < max(a,b) or t==1 and a==b==0:
print("NO")
exit()
print("YES")
d = dict(zip(range(8),[">",">^","^","^<","<","<v","v","v>",]))
def f(a,b):
if a>0 and b==0: return 0
if a>0 and b>0: return 1
if a==0 and b>0: return 2
if a<0 and b>0: return 3
if a<0 and b==0: return 4
if a<0 and b<0: return 5
if a==0 and b<0: return 6
if a>0 and b<0: return 7
if a==b==0: return 8
while t > 2:
if a >= 0 and b >= 0:
c = f(a,b)
print(d[c%8])
if a < 0: a += 1
elif a > 0: a -= 1
if b < 0: b += 1
elif b > 0: b -= 1
if c==8:
a -= 1
t -= 1
if t==2:
c = -1
if a==1 and b==0:
c = 2
b -= 1
elif a==1 and b>0:
c = 0
a -= 1
elif a==0 and b==1:
c = 0
a -= 1
elif a==-1 and b==1:
c = 2
b -= 1
elif a==-1 and b==0:
c = 2
b -= 1
elif a==-1 and b==-1:
c = 6
b += 1
elif a==0 and b==-1:
c = 0
a -= 1
elif a==1 and b==-1:
c = 0
a -= 1
else:
c = f(a,b)
if a < 0: a += 1
elif a > 0: a -= 1
if b < 0: b += 1
elif b > 0: b -= 1
if c==8:
a -= 1
#print(c)
print(d[c%8])
print(d[f(a,b)])
convexineq