QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#72808 | #4837. Ramen | ckiseki# | WA | 0ms | 3388kb | C++20 | 335b | 2023-01-19 14:48:59 | 2023-01-19 14:49:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n; cin >> n;
vector<int> a(n);
int64_t sum = 0;
for (int &ai : a) {
cin >> ai;
sum += ai;
if (sum <= 0)
return cout << "NO\n", 0;
}
cout << "YES\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3388kb
input:
3 1 2 -5
output:
NO
result:
wrong answer expected YES, found NO