結果
問題 |
No.921 ずんだアロー
|
ユーザー |
|
提出日時 | 2020-04-10 13:05:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 265 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 20,784 KB |
最終ジャッジ日時 | 2024-09-14 22:52:11 |
合計ジャッジ時間 | 3,154 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 20 WA * 2 |
ソースコード
MOD = 10 ** 9 + 7 INF = 10 ** 10 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from collections import deque from heapq import heapify,heappush,heappop def main(): n = int(input()) a = list(map(int,input().split())) a = [a[0]] + a + [a[-1]] ans = (n + 1)//2 cnt1 = (n + 1)//2 cnt2 = n//2 for i in range(1,n + 1): if i%2 == 0: if a[i - 1] == a[i] == a[i + 1]: cnt2 += 1 else: if a[i - 1] == a[i] == a[i + 1]: cnt1 += 1 ans = max(ans,cnt1,cnt2) print(ans) if __name__ =='__main__': main()