結果

問題 No.755 Zero-Sum Rectangle
ユーザー honda-keiohonda-keio
提出日時 2018-12-17 13:58:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 549 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 11,844 KB
実行使用メモリ 46,872 KB
最終ジャッジ日時 2023-10-25 23:28:33
合計ジャッジ時間 7,295 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 523 ms
46,872 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
evil_1 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N, M = map(int, input().split())
A = np.array([list(map(int, input().split())) for _ in range(M)])
xy = [list(map(int, input().split())) for _ in range(N)]
for n in range(N):
    count = 0
    for xu in range(xy[n][0]):
        for xd in range(xy[n][0]-1,M):
            for yl in range(xy[n][1]):
                for yr in  range(xy[n][1]-1,M):
                    if yl == yr and xu == xd:
                        continue
                    if A[xu:xd+1,yl:yr+1].sum() == 0:
                        count += 1
    print(count)
0