제출 #528497

#제출 시각아이디문제언어결과실행 시간메모리
528497MilosMilutinovicBomb (IZhO17_bomb)C++14
24 / 100
99 ms31044 KiB
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i ++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i ++) using namespace std; typedef long long LL; typedef pair<int, int> PII; int n, m, a[2505][2505]; int main() { scanf("%d%d", &n, &m); rep1(i, n) { char s[m + 1]; scanf("%s", s + 1); rep1(j, m) a[i][j] = s[j] - '0'; } int ansx = 1e9, ansy = 1e9; rep1(i, n) rep1(j, m) { if(a[i][j] == 0) continue; int ptr = j; while(ptr < m && a[i][ptr + 1] == 1) ptr ++; ansx = min(ansx, ptr - j + 1); j = ptr; } rep1(j, m) rep1(i, n) { if(a[i][j] == 0) continue; int ptr = i; while(ptr < n && a[ptr + 1][j] == 1) ptr ++; ansy = min(ansy, ptr - i + 1); i = ptr; } printf("%d", ansx * ansy); }

컴파일 시 표준 에러 (stderr) 메시지

bomb.cpp: In function 'int main()':
bomb.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d%d", &n, &m);
      |   ~~~~~^~~~~~~~~~~~~~~~
bomb.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     scanf("%s", s + 1);
      |     ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...