# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
170217 | theboatman | Bomb (IZhO17_bomb) | C++17 | 50 ms | 13184 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define y1 theboatman
#define make_struct(args...) {args}
using namespace std;
typedef long long ll;
const long long INF = ll(1e18) + 10;
const int inf = int(1e9) + 10;
const int N = int(1e6) + 10;
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector <string> a(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
}
int second = m;
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
if (a[i][j] == '1') {
int sz = 0;
while(j < m && a[i][j] == '1') {
j++;
sz++;
}
j--;
second = min(second, sz);
}
}
}
int first = n;
for(int j = 0; j < m; j++) {
for(int i = 0; i < n; i++) {
if (a[i][j] == '1') {
int sz = 0;
while(i < n && a[i][j] == '1') {
i++;
sz++;
}
i--;
first = min(first, sz);
}
}
}
cout << 1LL * first * second << "\n";
return 0;
}
/*
*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |