답안 #833209

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
833209 2023-08-22T03:13:10 Z vjudge1 Bomb (IZhO17_bomb) C++17
6 / 100
264 ms 19724 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pll pair<ll, ll>
using namespace std;
int m, n, ans;
string s[2500];
vector<int> v;

void sub1a(){
	int k=0;
	for(int i=0; i<=m; i++){
		if(i<m && s[1][i]=='1') k++;
		else{
			if(k>0) v.pb(k); k=0;
		}
	}
	sort(v.begin(), v.end());
	if(v.size()>0) ans=v[0];
}

void sub1b(){
	ans=1e5;
	int k=0;
	for(int i=1; i<=n+1; i++){
		if(i<=n && s[i][0]=='1') k++;
		else{
			if(k>0) v.pb(k); k=0;
		}
	}	
	sort(v.begin(), v.end());
	if(v.size()>0) ans=v[0];
}

int main(){
	cin >> n >> m;
	for(int i=1; i<=n; i++){
		cin >> s[i];
	}
	if(n==1) sub1a();
	else if(m==1) sub1b();
	
	cout << ans << endl;
	return 0;
}

Compilation message

bomb.cpp: In function 'void sub1a()':
bomb.cpp:17:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   17 |    if(k>0) v.pb(k); k=0;
      |    ^~
bomb.cpp:17:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   17 |    if(k>0) v.pb(k); k=0;
      |                     ^
bomb.cpp: In function 'void sub1b()':
bomb.cpp:30:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   30 |    if(k>0) v.pb(k); k=0;
      |    ^~
bomb.cpp:30:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   30 |    if(k>0) v.pb(k); k=0;
      |                     ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Incorrect 1 ms 340 KB Output isn't correct
8 Incorrect 0 ms 340 KB Output isn't correct
9 Incorrect 0 ms 340 KB Output isn't correct
10 Incorrect 0 ms 340 KB Output isn't correct
11 Incorrect 1 ms 340 KB Output isn't correct
12 Incorrect 0 ms 340 KB Output isn't correct
13 Incorrect 0 ms 340 KB Output isn't correct
14 Incorrect 0 ms 340 KB Output isn't correct
15 Incorrect 2 ms 388 KB Output isn't correct
16 Incorrect 0 ms 340 KB Output isn't correct
17 Incorrect 1 ms 340 KB Output isn't correct
18 Incorrect 0 ms 340 KB Output isn't correct
19 Incorrect 1 ms 340 KB Output isn't correct
20 Incorrect 3 ms 340 KB Output isn't correct
21 Incorrect 0 ms 340 KB Output isn't correct
22 Incorrect 0 ms 340 KB Output isn't correct
23 Incorrect 0 ms 340 KB Output isn't correct
24 Incorrect 1 ms 340 KB Output isn't correct
25 Incorrect 1 ms 340 KB Output isn't correct
26 Incorrect 1 ms 340 KB Output isn't correct
27 Incorrect 2 ms 468 KB Output isn't correct
28 Incorrect 2 ms 468 KB Output isn't correct
29 Incorrect 2 ms 468 KB Output isn't correct
30 Incorrect 3 ms 468 KB Output isn't correct
31 Incorrect 3 ms 468 KB Output isn't correct
32 Incorrect 3 ms 468 KB Output isn't correct
33 Incorrect 4 ms 596 KB Output isn't correct
34 Incorrect 2 ms 468 KB Output isn't correct
35 Incorrect 4 ms 596 KB Output isn't correct
36 Incorrect 4 ms 596 KB Output isn't correct
37 Incorrect 1 ms 340 KB Output isn't correct
38 Runtime error 93 ms 19604 KB Execution killed with signal 11
39 Incorrect 0 ms 340 KB Output isn't correct
40 Incorrect 14 ms 1108 KB Output isn't correct
41 Incorrect 0 ms 340 KB Output isn't correct
42 Incorrect 1 ms 340 KB Output isn't correct
43 Runtime error 95 ms 19576 KB Execution killed with signal 11
44 Incorrect 3 ms 596 KB Output isn't correct
45 Runtime error 248 ms 19588 KB Execution killed with signal 11
46 Runtime error 94 ms 19564 KB Execution killed with signal 11
47 Runtime error 93 ms 19648 KB Execution killed with signal 11
48 Runtime error 95 ms 19660 KB Execution killed with signal 11
49 Runtime error 95 ms 19660 KB Execution killed with signal 11
50 Runtime error 98 ms 19588 KB Execution killed with signal 11
51 Runtime error 95 ms 19660 KB Execution killed with signal 11
52 Runtime error 123 ms 19656 KB Execution killed with signal 11
53 Runtime error 95 ms 19684 KB Execution killed with signal 11
54 Runtime error 97 ms 19640 KB Execution killed with signal 11
55 Runtime error 97 ms 19724 KB Execution killed with signal 11
56 Runtime error 128 ms 19648 KB Execution killed with signal 11
57 Runtime error 95 ms 19636 KB Execution killed with signal 11
58 Runtime error 120 ms 19656 KB Execution killed with signal 11
59 Runtime error 102 ms 19660 KB Execution killed with signal 11
60 Runtime error 94 ms 19660 KB Execution killed with signal 11
61 Runtime error 95 ms 19660 KB Execution killed with signal 11
62 Runtime error 215 ms 19656 KB Execution killed with signal 11
63 Runtime error 98 ms 19556 KB Execution killed with signal 11
64 Runtime error 94 ms 19632 KB Execution killed with signal 11
65 Runtime error 92 ms 19620 KB Execution killed with signal 11
66 Runtime error 92 ms 19660 KB Execution killed with signal 11
67 Runtime error 95 ms 19660 KB Execution killed with signal 11
68 Runtime error 95 ms 19576 KB Execution killed with signal 11
69 Runtime error 97 ms 19696 KB Execution killed with signal 11
70 Incorrect 58 ms 7864 KB Output isn't correct
71 Runtime error 96 ms 19636 KB Execution killed with signal 11
72 Runtime error 93 ms 19580 KB Execution killed with signal 11
73 Runtime error 94 ms 19564 KB Execution killed with signal 11
74 Runtime error 95 ms 19656 KB Execution killed with signal 11
75 Runtime error 95 ms 19572 KB Execution killed with signal 11
76 Runtime error 103 ms 19624 KB Execution killed with signal 11
77 Runtime error 96 ms 19608 KB Execution killed with signal 11
78 Runtime error 94 ms 19648 KB Execution killed with signal 11
79 Runtime error 96 ms 19564 KB Execution killed with signal 11
80 Runtime error 95 ms 19656 KB Execution killed with signal 11
81 Runtime error 96 ms 19644 KB Execution killed with signal 11
82 Runtime error 120 ms 19592 KB Execution killed with signal 11
83 Runtime error 93 ms 19632 KB Execution killed with signal 11
84 Runtime error 95 ms 19632 KB Execution killed with signal 11
85 Runtime error 103 ms 19716 KB Execution killed with signal 11
86 Runtime error 94 ms 19672 KB Execution killed with signal 11
87 Runtime error 96 ms 19684 KB Execution killed with signal 11
88 Runtime error 96 ms 19648 KB Execution killed with signal 11
89 Runtime error 117 ms 19632 KB Execution killed with signal 11
90 Incorrect 56 ms 7884 KB Output isn't correct
91 Runtime error 94 ms 19660 KB Execution killed with signal 11
92 Runtime error 93 ms 19592 KB Execution killed with signal 11
93 Runtime error 150 ms 19636 KB Execution killed with signal 11
94 Runtime error 98 ms 19632 KB Execution killed with signal 11
95 Runtime error 101 ms 19660 KB Execution killed with signal 11
96 Runtime error 106 ms 19560 KB Execution killed with signal 11
97 Runtime error 264 ms 19660 KB Execution killed with signal 11
98 Runtime error 129 ms 19660 KB Execution killed with signal 11
99 Runtime error 113 ms 19608 KB Execution killed with signal 11
100 Runtime error 94 ms 19588 KB Execution killed with signal 11