Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: jackpapho
Problemset: ประมูลการกุศล
Language: cpp
Time: 0.005 second
Submitted On: 2026-10-01 14:03:37
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int n,sum = 0,num,max = 0;
cin >> n;
for (int i =0;i< n;i++){
cin >> num;
if (num > max){
max = num;
sum+=max;
}
}
cout << sum;
return 0;
}