結果

問題 No.3596 Queen Score Attack 1
コンテスト
ユーザー 回転
提出日時 2026-07-24 21:19:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 696 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 254 ms
コンパイル使用メモリ 96,104 KB
実行使用メモリ 85,672 KB
最終ジャッジ日時 2026-07-24 21:19:48
合計ジャッジ時間 4,574 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T = int(input())
for _ in range(T):
    H,W = list(map(int,input().split()))
    A = [list(map(int,input().split())) for _ in range(H)]

    flag = False
    for i in range(H):
        now = sorted(A[i])
        if(now[-1] + now[-2] > 0):
            flag = True

    for j in range(W):
        now = sorted([A[i][j] for i in range(H)])
        if(now[-1] + now[-2] > 0):
            flag = True

    for _ in range(2):
        for i in range(H+W-1):
            now = sorted([A[j][i-j] for j in range(max(0, i-W+1), min(i, H-1)+1)])
            if(len(now) > 2 and now[-1] + now[-2] > 0):
                flag = True
        A = [i[::-1] for i in A]


    print("infinite" if flag else "finite")
0