제출 #91356

#제출 시각아이디문제언어결과실행 시간메모리
91356emil_physmathBomb (IZhO17_bomb)C++14
18 / 100
446 ms132096 KiB
#include <iostream> #include <stdio.h> using namespace std; int a[2505][2505], temp[2505][2505]; int FindLen(int n, int m); int main() { int n, m; cin>>n>>m; for (int i=0; i<n; i++) for (int j=0; j<m; j++) { char temp; scanf(" %c", &temp); a[i][j]=temp-'0'; } int len=FindLen(n, m); for (int i=0; i<n; i++) for (int j=0; j<m; j++) temp[j][i]=a[i][j]; swap(n, m); for (int i=0; i<n; i++) for (int j=0; j<m; j++) a[i][j]=temp[i][j]; int wid=FindLen(n, m); cout<<wid*len<<'\n'; char I; cin >> I; return 0; } int FindLen(int n, int m) { int minLen=m; for (int i=0; i<n; i++) for (int stj=0; stj<m; stj++) { int j=stj; if (!a[i][j]) continue; while (j+1<m && a[i][j+1]) j++; minLen=min(minLen, j-stj+1); stj=j+1; } return minLen; }

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

bomb.cpp: In function 'int main()':
bomb.cpp:16:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c", &temp);
    ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...