제출 #833198

#제출 시각아이디문제언어결과실행 시간메모리
833198vjudge1Bomb (IZhO17_bomb)C++14
24 / 100
35 ms6612 KiB
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m, minh = 69420, minw = 69420, urutan; string s; vector<string> grid; cin >> n >> m; for(int i = 0; i < n; i++){ cin >> s; grid.push_back(s); } for(int i = 0; i < n; i++){ urutan = 0; for(int j = 0; j < m; j++){ if(grid[i][j] == '1'){ urutan++; } else{ if(urutan != 0){ minw = min(urutan, minw); } urutan = 0; } } if(urutan != 0){ minw = min(urutan, minw); } } if(urutan != 0){ minw = min(urutan, minw); } for(int i = 0; i < m; i++){ urutan = 0; for(int j = 0; j < n; j++){ if(grid[j][i] == '1'){ urutan++; } else{ if(urutan != 0){ minh = min(urutan, minh); } urutan = 0; } } if(urutan != 0){ minh = min(urutan, minh); } } if(urutan != 0){ minh = min(urutan, minh); } //cout << minh << " " << minw << endl; cout << minh*minw; }

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

bomb.cpp: In function 'int main()':
bomb.cpp:7:40: warning: 'urutan' may be used uninitialized in this function [-Wmaybe-uninitialized]
    7 |  int n, m, minh = 69420, minw = 69420, urutan;
      |                                        ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...