QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#244530 | #7728. Ramen | Ycfhnnd | WA | 1ms | 3420kb | C++20 | 707b | 2023-11-09 11:17:58 | 2023-11-09 11:17:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve(){
int n;
cin >> n;
vector<int>a(n);
for (int i = 0;i < n;i ++){
cin >> a[i];
}
if (n == 1){
cout << "Yes\n";
}else if (n == 2){
if (a[0] >= 0){
cout << "Yes\n";
}else{
cout << "No\n";
}
}else{
if (a[0] > 0 && a[1] > 0){
cout << "Yes\n";
}else{
cout << "No\n";
}
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3388kb
input:
3 1 2 -5
output:
Yes
result:
ok YES
Test #2:
score: 0
Accepted
time: 1ms
memory: 3396kb
input:
5 2 -5 2 3 1
output:
No
result:
ok NO
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3420kb
input:
5 3 -2 1 -1 -1
output:
No
result:
wrong answer expected YES, found NO [1st token]