結果
問題 |
No.208 王将
|
ユーザー |
|
提出日時 | 2016-10-31 20:34:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 21,120 KB |
最終ジャッジ日時 | 2024-11-25 00:14:27 |
合計ジャッジ時間 | 5,710 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 19 WA * 2 TLE * 2 |
ソースコード
#208.py tx,ty = input().split() hx,hy = input().split() tx,ty = int(tx),int(ty) hx,hy = int(hx),int(hy) x,y = 0,0 x_,y_ = 0,0 lx,ly = -1,-1 c = 0 while(1): lx = tx-x ly = ty-y if(lx+ly == 0): break c+=1 if(lx == ly): x+=1 y+=1 if(lx > ly): x+=1 if(lx < ly): y+=1 if(hx == x)&(hy == y): if(x_ != x)&(y_ != y): if(tx <= ty): x-=1 if(tx > ty): y-=1 if(x_ == x): y+=1 if(y_ == y): x+=1 x_,y_ = x,y print(c)