제출 #39222

#제출 시각아이디문제언어결과실행 시간메모리
39222yerkimbekovBomb (IZhO17_bomb)C++14
17 / 100
149 ms8308 KiB
/* ID: simpgoo1 TASK: LANG: C++14 STATUS: 🤠 */ // timus 219263UI #include <iostream> #include <map> #include <set> #include <stack> #include <cmath> #include <ctime> #include <queue> #include <vector> #include <iomanip> #include <cstdlib> #include <stdio.h> #include <string.h> #include <algorithm> #include <unordered_map> using namespace std; typedef long long ll; #define y1 needtrainharder #define F first #define S second #define gg exit(0) #define sz() size() #define pb push_back #define mp make_pair #define skip continue #define all(x) x.begin(), x.end() #define boost ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL) #define file(s,x) if(x == 1)freopen(s".in","r",stdin),freopen(s".out","w",stdout); #define task "sorting" const int INF = 1e9 + 100; const ll INFLL = 1e18 + 100; const double EPS = 1e-10; const int MAXN = 5e5 + 100; const int P = 51; const int mod = 1e9 + 7; char a[2505][2505]; int main(){ boost; srand(time(NULL)); if(fopen(task".in", "r")){ freopen(task".in", "r", stdin); freopen(task".out","w",stdout); } int n, m; cin >> n >> m; for(int i = 1; i <= n; ++i){ for(int j = 1; j <= m; ++j){ cin >> a[i][j]; } } int mnx = INF, mny = INF, cur = 0; for(int i = 1; i <= n; ++i){ cur = 0; for(int j = 1; j <= m; ++j){ if( a[i][j] == '1' ) ++cur; else{ if(cur != 0) mnx = min(mnx, cur); cur = 0; } } } if(cur != 0) mnx = min(mnx, cur); cur = 0; for(int j = 1; j <= m; ++j){ cur = 0; for(int i = 1; i <= n; ++i){ if(a[i][j] == '1'){ ++cur; }else{ if(cur != 0) mny = min(mny, cur); cur = 0; } } } if(cur != 0) mny = min(mny, cur); cout << mnx * 1ll * mny; return 0; }

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

bomb.cpp: In function 'int main()':
bomb.cpp:56:35: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen(task".in", "r", stdin);
                                   ^
bomb.cpp:57:35: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen(task".out","w",stdout); 
                                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...