Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Prap
Problemset: ประมูลการกุศล
Language: cpp
Time: 0.003 second
Submitted On: 2026-03-24 16:49:59
#include <iostream> #include <cmath> #include <string>
using namespace std;
int main () {
int N;
cin>>N;
int num;
int max = 0;
int count = 0;
for (int i = 0; i<N; i++) {
cin>>num;
if (num > max) {
count = count + num;
max = num;
}
}
cout<<count;
}