can someone please explain what is wrong with my solution
w(t) {
int n; cin >> n;
vector a(n);
f(i, n)cin >> a[i];
vector<int> t(n + 1);
t[0] = 0;
t[1] = 1;
for (int i = 2; i <= n; i++) {
if (a[i - 1] >= a[i - 2]) {
t[i] = 2 + t[i - 1];
}
else {
t[i] = 1 + t[i - 1];
}
}
cout << t[n] << endl;
}