結果
| 問題 |
No.1765 While Shining
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-03 17:53:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 407 bytes |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 24,504 KB |
| 最終ジャッジ日時 | 2024-07-05 21:18:39 |
| 合計ジャッジ時間 | 6,677 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 2 |
| other | -- * 22 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
S = [0] * N
now = 0
end = 0
while now < N - 1:
if A[now] == 0:
S[now] = 0
now += 1
continue
for i in range(now,N-1):
if A[i+1] == A[i]:
end = i+1
break
for i in range(now,end,2):
S[i] = end - i
now = end
sum = 0
for i in range(N):
sum += S[i]
print(sum)
#多分ok