結果

問題 No.208 王将
ユーザー TeraokaAkihiro
提出日時 2016-10-31 20:32:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-25 00:08:42
合計ジャッジ時間 1,824 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#208.py
#tx,ty = input().split()
#hx,hy = input().split()
#tx,ty = int(tx),int(ty)
#hx,hy = int(hx),int(hy)
tx,ty = 2,1
hx,hy = 1,1
x,y = 0,0
x_,y_ = 0,0
lx,ly = -1,-1
c = 0

while(1):
    c += 1
    lx = tx-x
    ly = ty-y
    if(lx+ly == 0):
        break
    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)
0