Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: eexd

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-06 01:51:05

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

int32_t main()
{
    cin.tie(0); ios::sync_with_stdio(0);

    int q; cin>>q;

    int sum = 0;
    int max = -1;
    while(q--)
    {
        int n; cin>>n;
        if (n>max)
        {
            max = n;
            sum += n;
        }
    }
    cout << sum << '\n';

    return (0);
}