Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: ssens3

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-04 11:20:58

#include <iostream>
using namespace std;
int main(){
    int n, x, mx = -1, s = 0; cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x;
        if (x > mx){
            mx = x; s += x;
        }
    }
    cout << s;
}