QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#454757 | #8813. Records in Chichén Itzá | yemuzhe | WA | 0ms | 1476kb | C++14 | 484b | 2024-06-25 13:20:23 | 2024-06-25 13:20:24 |
Judging History
answer
#include <cstdio>
#include <algorithm>
#define N 100005
using namespace std;
int T, n, cnt, a[N];
bool check ()
{
if (cnt == 2 || a[cnt] == 2) return 0;
if (cnt == 3) return a[1] < a[3];
return 1;
}
int main ()
{
scanf ("%d", &T);
while (T --)
{
scanf ("%d", &n), cnt = 0;
for (int i = 1, x; i <= n; i ++)
{
scanf ("%d", &x);
if (x > 1) a[++ cnt] = x;
}
sort (a + 1, a + cnt + 1);
puts (check () ? "Yes" : "No");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1408kb
input:
3 6 1 1 1 1 3 3 5 1 1 2 2 2 10 1 1 1 1 2 2 2 2 3 3
output:
No No Yes
result:
ok 3 tokens
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 1476kb
input:
1 2 1 1
output:
Yes
result:
wrong answer 1st words differ - expected: 'No', found: 'Yes'