結果
問題 | No.1714 Tag on Grid |
ユーザー |
|
提出日時 | 2021-10-22 22:40:02 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-23 06:21:46 |
合計ジャッジ時間 | 3,495 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
def lscan; gets.split.map(&:to_i); enddef solve(h,w,ay,ax,by,bx)return solve(w,h,ax,ay,bx,by) if h > wreturn true if w == 1d = (ax-bx).abs + (ay-by).absreturn true if d%2 == 1falseendh,w = lscanay,ax = lscanby,bx = lscanputs solve(h,w,ay,ax,by,bx) ? 'Yes' : 'No'