# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833144 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 87 ms | 6728 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
const int INF = 2147483645;
const int maxN = (int)5e5+5;
const ll LLINF = LLONG_MAX;
//const ll mod = 998244353;
const ll mod = 1000000007;
char arr[2505][2505];
void solv() {
int n,m,mnv=INF, mnh=INF;
cin>>n>>m;
for (int i=0;i<n;i++) {
for (int j=0;j<m;j++) cin>>arr[i][j];
}
for (int i=0;i<m;i++) {
for (int j=0;j<n;j++) {
int ctr = 0;
while (j < n && arr[j][i] == '1') {
ctr++; j++;
}
if (ctr) mnv = min(mnv, ctr);
}
}
for (int i=0;i<n;i++) {
for (int j=0;j<m;j++) {
int ctr = 0;
while (j < n && arr[i][j] == '1') {
ctr++; j++;
}
if (ctr) mnh = min(mnh, ctr);
}
}
cout<<mnv*mnh<<'\n';
}
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int t=1;
// cin>>t;
while (t--) solv();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |