QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#454757#8813. Records in Chichén ItzáyemuzheWA 0ms1476kbC++14484b2024-06-25 13:20:232024-06-25 13:20:24

Judging History

你现在查看的是最新测评结果

  • [2024-06-25 13:20:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1476kb
  • [2024-06-25 13:20:23]
  • 提交

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'