結果

問題 No.1141 田グリッド
ユーザー 酒井大輔酒井大輔
提出日時 2020-07-31 22:43:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 571 bytes
コンパイル時間 1,447 ms
コンパイル使用メモリ 164,372 KB
実行使用メモリ 8,204 KB
最終ジャッジ日時 2023-09-21 01:18:39
合計ジャッジ時間 5,588 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int d = 1000000007;

int main(){
    int h, w;
    cin >> h >> w;
    int a[h][w];
    rep(i,h)rep(j,w){
        cin >> a[i][j];
    }
    int q;
    cin >> q;
    rep(i,q){
        int r, c;
        ll ans = 1;
        cin >> r >> c;
        --r;
        --c;
        rep(j,h)rep(k,w){
            if(j == r || k == c) continue;
            ans *= a[j][k];
        }
        cout << ans % d << endl;
    }
    return 0;
}
0