teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

5

修正

2020/10/02 10:40

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -2,4 +2,5 @@
2
2
  ```Python
3
3
  from itertools import chain
4
4
  print(*chain.from_iterable(grid))
5
+ # 0 0 1 0 0 0 1 1 1 0 0 1 1 1 0 0 0 1 0 0
5
6
  ```

4

修正

2020/10/02 10:40

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -1,6 +1,5 @@
1
1
  `for`を使いたくないなら、
2
2
  ```Python
3
3
  from itertools import chain
4
- new_grid = chain.from_iterable(grid)
4
+ print(*chain.from_iterable(grid))
5
- print(*new_grid)
6
5
  ```

3

修正

2020/10/02 10:39

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -2,5 +2,5 @@
2
2
  ```Python
3
3
  from itertools import chain
4
4
  new_grid = chain.from_iterable(grid)
5
- print(" ".join(new_grid))
5
+ print(*new_grid)
6
6
  ```

2

追記

2020/10/02 10:37

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -1,3 +1,4 @@
1
+ `for`を使いたくないなら、
1
2
  ```Python
2
3
  from itertools import chain
3
4
  new_grid = chain.from_iterable(grid)

1

追記

2020/10/02 10:17

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  ```Python
2
- from itertools import chain
2
+ from itertools import chain
3
3
  new_grid = chain.from_iterable(grid)
4
4
  print(" ".join(new_grid))
5
5
  ```