回答編集履歴

1

コード修正

2019/04/16 07:18

投稿

can110
can110

スコア38266

test CHANGED
@@ -8,9 +8,13 @@
8
8
 
9
9
  A = [0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0]
10
10
 
11
+ N = 3 # 1の連続数
12
+
13
+
14
+
11
15
  s = ''.join(map(str,A)) # リスト→文字列
12
16
 
13
- m = re.search(r'111',s)
17
+ m = re.search('1'*N,s)
14
18
 
15
19
  if m:
16
20