結果

問題 No.755 Zero-Sum Rectangle
ユーザー 👑 tatyamtatyam
提出日時 2018-11-15 16:46:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 69,688 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 06:49:27
合計ジャッジ時間 5,237 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
    int n,m;
    cin >> n >> m;
    ll a[m+1][m+1];
    rep(i,1,m+1) rep(j,1,m+1) cin >> a[i][j];
    rep(i,1,m+1) rep(j,1,m+1) a[i][j] += a[i][j-1];
    rep(j,1,m+1) rep(i,1,m+1) a[i][j] += a[i-1][j];
    rep(i,0,n) {
        int x,y;
        cin >> x >> y;
        int ans = 0;
        rep(i,0,x) rep(j,0,y) rep(k,x,m+1) rep(l,y,m+1) if(a[i][j] - a[i][l] - a[k][j] + a[k][l] == 0) ans++;
        cout << ans << endl;
    }
}
0