結果
| 問題 | No.3606 Ice Grid Game |
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2026-07-31 23:12:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,641 bytes |
| 記録 | |
| コンパイル時間 | 793 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 506,980 KB |
| 最終ジャッジ日時 | 2026-07-31 23:13:10 |
| 合計ジャッジ時間 | 4,680 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 9 |
ソースコード
Q=int(input())
for _ in range(Q):
H,W,a,b=map(int,input().split())
a-=1
b-=1
DX=[1,0,-1,0]
DY=[0,1,0,-1]
ans='Bob'
for i in range(4):
dx,dy=DX[i],DY[i]
if 0<=a+dx<H and 0<=b+dy<W:
t=False
for j in range(4):
dx,dy=DX[i],DY[i]
used=[[False]*W for i in range(H)]
nowx,nowy=a,b
while True:
used[nowx][nowy]=True
if 0<=nowx+dx<H and 0<=nowy+dy<W:
nowx+=dx
nowy+=dy
else:
break
dx,dy=DX[j],DY[j]
count=0
if 0<=nowx+dx<H and 0<=nowy+dy<W and used[nowx+dx][nowy+dy]==False:
nowx+=dx
nowy+=dy
count+=1
while True:
used[nowx][nowy]=True
if 0<=nowx+dx<H and 0<=nowy+dy<W and used[nowx+dx][nowy+dy]==False:
nowx+=dx
nowy+=dy
else:
break
while True:
p=False
for k in range(4):
dx,dy=DX[k],DY[k]
if 0<=nowx+dx<H and 0<=nowy+dy<W and used[nowx+dx][nowy+dy]==False:
p=True
count+=1
nowx+=dx
nowy+=dy
count+=1
while True:
used[nowx][nowy]=True
if 0<=nowx+dx<H and 0<=nowy+dy<W and used[nowx+dx][nowy+dy]==False:
nowx+=dx
nowy+=dy
else:
break
break
if p==False:
break
if count%2==1:
t=True
if t==True:
ans='Alice'
print(ans)
ゼット