답안 #39221

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
39221 2018-01-10T07:55:39 Z yerkimbekov Bomb (IZhO17_bomb) C++14
0 / 100
183 ms 8308 KB
/*
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;
}

Compilation message

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);
         ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 8308 KB Output isn't correct
2 Incorrect 0 ms 8308 KB Output isn't correct
3 Incorrect 3 ms 8308 KB Output isn't correct
4 Incorrect 3 ms 8308 KB Output isn't correct
5 Incorrect 0 ms 8308 KB Output isn't correct
6 Incorrect 0 ms 8308 KB Output isn't correct
7 Incorrect 0 ms 8308 KB Output isn't correct
8 Incorrect 0 ms 8308 KB Output isn't correct
9 Incorrect 0 ms 8308 KB Output isn't correct
10 Incorrect 0 ms 8308 KB Output isn't correct
11 Incorrect 0 ms 8308 KB Output isn't correct
12 Incorrect 0 ms 8308 KB Output isn't correct
13 Incorrect 0 ms 8308 KB Output isn't correct
14 Incorrect 0 ms 8308 KB Output isn't correct
15 Incorrect 0 ms 8308 KB Output isn't correct
16 Incorrect 0 ms 8308 KB Output isn't correct
17 Incorrect 0 ms 8308 KB Output isn't correct
18 Incorrect 0 ms 8308 KB Output isn't correct
19 Incorrect 0 ms 8308 KB Output isn't correct
20 Incorrect 0 ms 8308 KB Output isn't correct
21 Incorrect 0 ms 8308 KB Output isn't correct
22 Incorrect 0 ms 8308 KB Output isn't correct
23 Incorrect 0 ms 8308 KB Output isn't correct
24 Incorrect 0 ms 8308 KB Output isn't correct
25 Incorrect 0 ms 8308 KB Output isn't correct
26 Incorrect 0 ms 8308 KB Output isn't correct
27 Incorrect 0 ms 8308 KB Output isn't correct
28 Incorrect 0 ms 8308 KB Output isn't correct
29 Incorrect 3 ms 8308 KB Output isn't correct
30 Incorrect 0 ms 8308 KB Output isn't correct
31 Incorrect 6 ms 8308 KB Output isn't correct
32 Incorrect 3 ms 8308 KB Output isn't correct
33 Incorrect 3 ms 8308 KB Output isn't correct
34 Incorrect 0 ms 8308 KB Output isn't correct
35 Incorrect 3 ms 8308 KB Output isn't correct
36 Incorrect 3 ms 8308 KB Output isn't correct
37 Incorrect 0 ms 8308 KB Output isn't correct
38 Incorrect 109 ms 8308 KB Output isn't correct
39 Incorrect 0 ms 8308 KB Output isn't correct
40 Incorrect 16 ms 8308 KB Output isn't correct
41 Incorrect 0 ms 8308 KB Output isn't correct
42 Incorrect 0 ms 8308 KB Output isn't correct
43 Incorrect 113 ms 8308 KB Output isn't correct
44 Incorrect 3 ms 8308 KB Output isn't correct
45 Incorrect 183 ms 8308 KB Output isn't correct
46 Incorrect 136 ms 8308 KB Output isn't correct
47 Incorrect 129 ms 8308 KB Output isn't correct
48 Incorrect 129 ms 8308 KB Output isn't correct
49 Incorrect 153 ms 8308 KB Output isn't correct
50 Incorrect 139 ms 8308 KB Output isn't correct
51 Incorrect 163 ms 8308 KB Output isn't correct
52 Incorrect 133 ms 8308 KB Output isn't correct
53 Incorrect 129 ms 8308 KB Output isn't correct
54 Incorrect 156 ms 8308 KB Output isn't correct
55 Incorrect 96 ms 8308 KB Output isn't correct
56 Incorrect 123 ms 8308 KB Output isn't correct
57 Incorrect 109 ms 8308 KB Output isn't correct
58 Incorrect 133 ms 8308 KB Output isn't correct
59 Incorrect 136 ms 8308 KB Output isn't correct
60 Incorrect 153 ms 8308 KB Output isn't correct
61 Incorrect 166 ms 8308 KB Output isn't correct
62 Incorrect 146 ms 8308 KB Output isn't correct
63 Incorrect 126 ms 8308 KB Output isn't correct
64 Incorrect 129 ms 8308 KB Output isn't correct
65 Incorrect 146 ms 8308 KB Output isn't correct
66 Incorrect 129 ms 8308 KB Output isn't correct
67 Incorrect 146 ms 8308 KB Output isn't correct
68 Incorrect 139 ms 8308 KB Output isn't correct
69 Incorrect 126 ms 8308 KB Output isn't correct
70 Incorrect 126 ms 8308 KB Output isn't correct
71 Incorrect 109 ms 8308 KB Output isn't correct
72 Incorrect 119 ms 8308 KB Output isn't correct
73 Incorrect 123 ms 8308 KB Output isn't correct
74 Incorrect 116 ms 8308 KB Output isn't correct
75 Incorrect 136 ms 8308 KB Output isn't correct
76 Incorrect 126 ms 8308 KB Output isn't correct
77 Incorrect 109 ms 8308 KB Output isn't correct
78 Incorrect 129 ms 8308 KB Output isn't correct
79 Incorrect 116 ms 8308 KB Output isn't correct
80 Incorrect 106 ms 8308 KB Output isn't correct
81 Incorrect 116 ms 8308 KB Output isn't correct
82 Incorrect 123 ms 8308 KB Output isn't correct
83 Incorrect 116 ms 8308 KB Output isn't correct
84 Incorrect 133 ms 8308 KB Output isn't correct
85 Incorrect 156 ms 8308 KB Output isn't correct
86 Incorrect 129 ms 8308 KB Output isn't correct
87 Incorrect 119 ms 8308 KB Output isn't correct
88 Incorrect 113 ms 8308 KB Output isn't correct
89 Incorrect 123 ms 8308 KB Output isn't correct
90 Incorrect 69 ms 8308 KB Output isn't correct
91 Incorrect 113 ms 8308 KB Output isn't correct
92 Incorrect 119 ms 8308 KB Output isn't correct
93 Incorrect 163 ms 8308 KB Output isn't correct
94 Incorrect 106 ms 8308 KB Output isn't correct
95 Incorrect 113 ms 8308 KB Output isn't correct
96 Incorrect 119 ms 8308 KB Output isn't correct
97 Incorrect 126 ms 8308 KB Output isn't correct
98 Incorrect 116 ms 8308 KB Output isn't correct
99 Incorrect 96 ms 8308 KB Output isn't correct
100 Incorrect 116 ms 8308 KB Output isn't correct