Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: SayRo

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-08 10:13:21

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

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