Submission

Status:
PPPPPPPPPP

Score: 100

User: Namkhing

Problemset: ประมูลการกุศล

Language: cpp

Time: 0.002 second

Submitted On: 2025-04-11 15:22:46

#include <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(nullptr)->ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int mx = -1;
    int sum = 0;
    while (n--) {
        int x;
        cin >> x;
        if (mx < x) {
            mx = x;
            sum += x;
        }
    }
    cout << sum;
}