結果
問題 |
No.921 ずんだアロー
|
ユーザー |
|
提出日時 | 2020-04-10 13:46:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 21,016 KB |
最終ジャッジ日時 | 2024-09-15 00:14:20 |
合計ジャッジ時間 | 2,651 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 11 RE * 11 |
ソースコード
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())) + [-1] ans = (n + 1)//2 cnt = 0 i = 0 while i < n + 1: if a[i] == a[i + 1]: i += 1 cnt += 1 else: i += 2 cnt += 1 ans = max(ans,cnt) print(ans) if __name__ =='__main__': main()