Die Zuckerbäckerin Poster

Die Zuckerbäckerin

Detaylar

#include <bits/stdc++> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } // Find the maximum sum of k consecutive elements int max_sum = 0; for (int i = 0; i + k - 1 < n; i++) { int sum = 0; for (int j = i; j < i + k; j++) { sum += a[j]; } max_sum = max(max_sum, sum); } cout << max_sum << endl; return 0; }

Film Detayları

0 Dk

12-03-1972

Deutsch

0 $

0 $

Yorumlar (0)

Yorum Yaz

Önerilenler

Önerilen Filmler

Bağla Beni Poster

Bağla Beni

22-01-1990
  • 102 dk 6.867
Im Himmel ist die Hölle los Poster
  • 82 dk 5.2
A Bird in the Hand Poster

A Bird in the Hand

29-04-1929
  • 9 dk 0
Tryllesækken Poster

Tryllesækken

01-10-1907
  • 4 dk 0