結果

問題 No.3324 ハイライト動画
コンテスト
ユーザー iastm
提出日時 2025-11-01 15:03:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 105,748 KB
最終ジャッジ日時 2025-11-01 15:03:31
合計ジャッジ時間 4,964 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]

result = []
for a in A:
    if result and result[-1][0] + result[-1][1] == a:
        result[-1][1] += 1
    else:
        result.append([a, 1])

print(len(result))
for r in result:
    print(*r)
0