mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-01-11 18:51:59 +00:00
P1614 爱与愁的心痛
R36322094
This commit is contained in:
parent
6a7508483b
commit
2ada273bc8
22
problem/P1614/P1614.cpp
Normal file
22
problem/P1614/P1614.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
// https://www.luogu.com.cn/record/36322094
|
||||
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n, m, a[100005], minn=100000, t=0;
|
||||
cin >> n >> m;
|
||||
for(int i = 1 ; i <= n ; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
for(int i = 1 ; i <= n-m+1 ; i++) {
|
||||
for(int j = 1 ; j <= m ; j++) {
|
||||
t += a[i+j-1];
|
||||
}
|
||||
minn = min(t, minn);
|
||||
t = 0;
|
||||
}
|
||||
cout << minn << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user