結果
問題 |
No.2888 Mamehinata
|
ユーザー |
|
提出日時 | 2024-09-18 23:02:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 671 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-18 23:02:43 |
合計ジャッジ時間 | 4,215 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 52 |
ソースコード
n, m = map(int, input().split()) for i in range(n): if i == 0: point.append(2) else: point.append(0) for _ in range(m): new_point = point.copy() for i in range(n): if i == 0: left = point[n - 1] right = point[1] elif i == n - 1: left = point[n - 2] right = point[0] else: left = point[i - 1] right = point[i + 1] if left == 2 or right == 2: new_point[i] = 1 elif point[i] == 2: new_point[i] = 0 else: new_point[i] = 1 point = new_point num = point.count(2) print(num)