結果
問題 | No.240 ナイト散歩 |
ユーザー |
![]() |
提出日時 | 2022-11-01 20:35:58 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 61,740 KB |
最終ジャッジ日時 | 2024-07-16 10:00:48 |
合計ジャッジ時間 | 2,698 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
from itertools import product X, Y = map(int, input().split()) dir=[(0,0),(-2,-1),(-2,1),(-1,-2),(-1,2),(1,-2),(1,2),(2,-1),(2,1)] s=set() for p in product(dir,repeat=3): x,y=0,0 for i in range(3): dx,dy=p[i] x+=dx y+=dy s.add((x,y)) if (X,Y) in s: print("YES") else: print("NO")