Beginner Free Contest 1 - KSUM

View as PDF

Submit solution

Points: 0.18 (partial)
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

In case the statement didn't load correctly, you can download the statement here: Statement

Lưu ý: các bạn không nhập, xuất dữ liệu bằng file kể cả khi đề bài có yêu cầu. Đọc, ghi dữ liệu được thực hiện ở stdin và stdout.


Comments

Please read the guidelines before commenting.



  • 0
    _no_love_no_gain_  commented on March 31, 2025, 5:07 a.m.
    long long s = 0;
        for(int i = 0; i < k; ++i) s += w[i];
        long long ma = s;
        for (int i = k; i < n; ++i) {
            s += w[i] - w[i - k];
            if (s > ma)  ma = s;
        }
        cout << ma;
    

  • -25
    CBNK29_ANHTUAN  commented on Jan. 14, 2022, 1:14 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.