| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 337871 | boykut | Bomb (IZhO17_bomb) | C++14 | 385 ms | 12780 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2501;
//int dp[MAXN][MAXN];
char a[MAXN][MAXN];
//int sum[MAXN][MAXN];
signed main() {
   int n, m;
   cin >> n >> m;
   for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
         cin >> a[i][j];
         //sum[i][j] = sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+int(a[i][j] == '1');
      }
   }
   //for (int i = 1; i <= n; i++) {
   //   for (int j = 1; j <= n; j++) {
   //      for (int a = 1; a <= i; a++) {
   //         for (int b = 1; b <= j; b++) {
   //            if (get(a, b, i, j))
   //               dp[i - a + 1][j - b + 1] = 1;
   //         }
   //      }
   //   }
   //}
   if (n == 1) {
      int ans = 2e9;
      for (int l = 1; l <= m;) {
         int r = l, cnt = 0;
         while (r <= m && a[1][r] == '1') cnt++, r++;
         if (cnt)
            ans = min(ans, cnt);
         l = r + 1;
      }
      cout << ans << '\n';
   } else if (m == 1) {
      int ans = 2e9;
      for (int l = 1; l <= n; l++) {
         int r = l, cnt = 0;
         while (r <= m && a[r][1] == '1') cnt++, r++;
         if (cnt)
            ans = min(ans, cnt);
      }
      cout << ans << '\n';
   }
   return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
