結果
| 問題 |
No.2888 Mamehinata
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-18 22:55:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 654 bytes |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-18 22:55:55 |
| 合計ジャッジ時間 | 4,295 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 52 |
ソースコード
n = int(input())
point = [2] + [0] * (n - 1)
# mの回数だけ更新を繰り返す場合
m = int(input())
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)