結果
| 問題 | No.1141 田グリッド |
| コンテスト | |
| ユーザー |
Dske
|
| 提出日時 | 2020-07-31 23:07:06 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 795 bytes |
| 記録 | |
| コンパイル時間 | 1,023 ms |
| コンパイル使用メモリ | 181,300 KB |
| 実行使用メモリ | 9,984 KB |
| 最終ジャッジ日時 | 2026-03-28 10:50:34 |
| 合計ジャッジ時間 | 4,687 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 20 |
ソースコード
#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];
// ll ans = 1;
rep(i,h)rep(j,w){
cin >> a[i][j];
// ans *= a[i][j];
}
int q;
cin >> q;
rep(i,q){
int r, c;
ll ans = 1;
int cnt = 0;
cin >> r >> c;
--r;
--c;
rep(j,h)rep(k,w){
if(j == r || k == c) continue;
ans *= a[j][k];
cnt++;
if(cnt == 1) continue;
ans %= d;
// if(j == r) ans /= a[r][k];
// if(k == c) ans /= a[j][c];
}
cout << ans << endl;
}
return 0;
}
Dske