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

How to Train a Dog Poster

How to Train a Dog

01-07-1936
  • 8 dk 7
Freek de Jonge: De Volgende Poster
  • 0 dk 0
Maccheroni Poster

Maccheroni

24-10-1985
  • 104 dk 6.2
Les Nouveaux maîtres Poster
  • 92 dk 0