Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: NovemNotes

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-15 13:56:43

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

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;cin >> n;
    int sum=0,mx=0;
    while(n--){
        int x;cin >> x;
        if(x>mx){
            mx=x;
            sum+=x;
        }
    }
    cout << sum << "\n";
    return 0;
}