十分求调
查看原帖
十分求调
1142439
ZXmax2005楼主2024/11/8 11:17
#include<bits/stdc++.h>

using namespace std;

const int N = 1e4 + 10;

int main()
{
	int n, m;
	cin >> n >> m;
	int a[N];
	for (int i = 0; i < n; i++) cin >> a[i];
	int cnt_min = 360;
	for (int i = 0; i < n - 2; i++)
	{
		if ((a[i] + a[i + 1] + a[i + 2]) < cnt_min) cnt_min = a[i] + a[i + 1] + a[i + 2];
	}
	cout << cnt_min;
	return 0;
}
2024/11/8 11:17
加载中...