제출 #39221

#제출 시각아이디문제언어결과실행 시간메모리
39221yerkimbekovBomb (IZhO17_bomb)C++14
0 / 100
183 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 sc(x) scanf("%d", &x);
#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;


/*


5 4 8 1 7 2 3 6 


1  3  5  7 | 2 4 6 8


*/

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;
  sc(n);sc(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 * mny;

  return 0;
}

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

bomb.cpp: In function 'int main()':
bomb.cpp:69: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:70: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); 
                                   ^
bomb.cpp:35:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 #define sc(x) scanf("%d", &x);
                              ^
bomb.cpp:74:3: note: in expansion of macro 'sc'
   sc(n);sc(m);
   ^
bomb.cpp:35:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 #define sc(x) scanf("%d", &x);
                              ^
bomb.cpp:74:9: note: in expansion of macro 'sc'
   sc(n);sc(m);
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...