I am running this solution for 264 Div 2 B and am getting the correct response (4) for problem one, but when I submit it I'm get back "Wrong answer problem 1" and it's telling me the program is returning 0. I've trying unsuccessfully submitting under all three C++ options but I'm not sure why the online grader is returning a different answer than what I get when I run it on my computer here.... can anyone please help me?
include <stdio.h>
include <stdlib.h>
include <stdarg.h>
include <math.h>
include
include
typedef long long ll; typedef unsigned char byte; using namespace std;
int main(int argc, char* argv[]) {
ll n, x, y=0, ret=0, e=0;
vector<ll> vll;
cin >> n;
for (int i =0; i < n; ++i) {
cin >> x;
vll.push_back(x);
}
for (int i = 0; i < vll.size(); ++i) {
x = vll[i];
e += x-y;
if (e < 0) {
ret += abs(e);
e=0;
}
y=x;
}
cout << ret << endl;
return 7;
}
Thanks!!








