제출 #38356

#제출 시각아이디문제언어결과실행 시간메모리
38356mirbek01Bomb (IZhO17_bomb)C++14
24 / 100
406 ms8144 KiB
# include <bits/stdc++.h> #pragma GCC optimize("Ofast") # define pb push_back # define fr first # define sc second # define mk make_pair using namespace std; const long long linf = 1e18 + 7; const int inf = 1e9 + 7; const int N = 2505; typedef long long ll; int n, m, a = inf, b = inf; char ch[N][N]; int main(){ scanf("%d %d", &n, &m); for(int i = 1; i <= n; i ++){ scanf("\n"); for(int j = 1; j <= m; j ++) scanf("%c", &ch[i][j]); } for(int i = 1; i <= n; i ++){ int cur = 0; for(int j = 1; j <= m; j ++){ if(ch[i][j] == '1') cur ++; else{ if(cur) a = min(a, cur); cur = 0; } } if(cur) a = min(a, cur); } for(int i = 1; i <= m; i ++){ int cur = 0; for(int j = 1; j <= n; j ++){ if(ch[j][i] == '1') cur ++; else { if(cur) b = min(b, cur); cur = 0; } } if(cur) b = min(b, cur); } if(a == inf) printf("0"); else printf("%d", a * b); }

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

bomb.cpp: In function 'int main()':
bomb.cpp:21:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%d %d", &n, &m);
                             ^
bomb.cpp:24:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("\n");
                        ^
bomb.cpp:26:41: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
                   scanf("%c", &ch[i][j]);
                                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...