結果

問題 No.3324 ハイライト動画
コンテスト
ユーザー あじゃじゃ
提出日時 2025-02-27 07:39:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 101,024 KB
最終ジャッジ日時 2025-11-01 14:30:12
合計ジャッジ時間 3,844 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int ,input().split() )
A=[int(x) for x in input().split()]
A.append(n+10)#番兵
ans=[]
top=A[0]
cnt=1
for i in range(m):
	if A[i+1]-A[i]>1:
		ans.append((top,cnt))
		cnt=1
		top=A[i+1]
	else:
		cnt+=1
print(len(ans))
for a in ans:
	print(*a)
0