結果
| 問題 |
No.2888 Mamehinata
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-18 23:01:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 606 bytes |
| コンパイル時間 | 192 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,696 KB |
| 最終ジャッジ日時 | 2024-09-18 23:01:16 |
| 合計ジャッジ時間 | 5,421 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 10 TLE * 1 -- * 41 |
ソースコード
n, m = map(int, input().split())
point = [2] + [0] * (n - 1)
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)