| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 39228 | yerkimbekov | Bomb (IZhO17_bomb) | C++14 | 166 ms | 8308 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
ID: simpgoo1
TASK:
LANG: C++14
*/
// 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;
  bool tr = 0;
  for(int i = 1; i <= n; ++i){
    for(int j = 1; j <= m; ++j){
      cin >> a[i][j];
      if( a[i][j] == '1' )
        tr = 1;
    }
  }
  if(!tr){
    cout << 0;gg;
  }
 
  ll mnx = INFLL, mny = INFLL, 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);
  }
 
  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);
  }
  if(cur != 0)
    mny = min(mny, cur);
 
  cout << mnx * 1ll * mny;
 
  return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
