QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#404672 | #6784. Problem Preparation | LZDY | AC ✓ | 16ms | 3636kb | C++14 | 633b | 2024-05-04 13:55:34 | 2024-05-04 13:55:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n];
int t=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(a[i]==1) t++;
}
if(n<10||n>13)
{
cout<<"No"<<endl;
continue;
}
sort(a,a+n);
if(a[0]!=1)
{
cout<<"No"<<endl;
continue;
}
if(t<2)
{
cout<<"No"<<endl;
continue;
}
int max1=a[n-1];
int f=0;
for(int i=0;i<n-1;i++)
{
t=a[i+1]-a[i];
if(t>2&&a[i+1]!=max1)
f=1;
}
if(f) cout<<"No"<<endl;
else
cout<<"Yes"<<endl;
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3552kb
input:
8 9 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 999 1 1 2 3 4 5 6 7 8 9 11 999 1 3 5 7 9 11 13 17 19 21 10 15 1 13 17 1 7 9 5 3 11 13 1 1 1 1 1 1 1 1 1 1 1 1 2 10 2 3 4 5 6 7 8 9 10 11 10 15 1 13 3 6 5 4 7 1 14
output:
No No Yes No Yes Yes No No
result:
ok 8 lines
Test #2:
score: 0
Accepted
time: 16ms
memory: 3636kb
input:
10000 9 1 1 1 1 1 1 1 1 2 10 1 1 1 1 1 1 1 1 1 2 10 0 1 1 1 1 1 1 1000 1 1 11 1 2 3 4 5 6 7 8 9 10 11 11 1 1 2 3 4 5 6 7 8 9 10 11 -1 1 1 1 1 1 1 1 2 1 1 11 1 1 3 5 7 9 11 13 15 17 19 12 1 1 3 5 7 9 11 13 15 17 19 1000 12 1 2 3 5 7 9 11 13 15 17 19 1000 11 1 1 2 3 4 5 6 9 11 17 22 13 10 1 5 9 10 5 7...
output:
No Yes No No Yes No Yes Yes No No No No No No No No No No No No No Yes No Yes No No No No No No No No No No No No No No No Yes No No No No No No No Yes No No No No No Yes No No No Yes No No Yes No No Yes No Yes No No No No No No No No No No No No No No No No Yes No No Yes Yes No No No No No No No No...
result:
ok 10000 lines