QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#360305#6784. Problem PreparationkdenWA 1ms3964kbC++14844b2024-03-21 17:13:142024-03-21 17:13:15

Judging History

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

  • [2024-03-21 17:13:15]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3964kb
  • [2024-03-21 17:13:14]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t,n,s[10010];
    scanf("%d",&t);
    while(t--){
        int num=0,max1=-2000,tei,sign1=0,sum[10010];
        scanf("%d",&n);
        for(int i=1;i<=n;i++){
            scanf("%d",&s[i]);
            if(s[i]==1){num++;}
            if(s[i]<1){sign1=1;}
        }
        if(num<2){cout<<"No"<<endl;continue;}
        if(sign1){cout<<"No"<<endl;continue;}
        sort(s+1,s+n+1);
        for(int i=1;i<=n;i++){
            if(max1<s[i]){max1=s[i];tei=i;}
        }
        for(int i=2;i<=n;i++){
            sum[i]=abs(sum[i]-sum[i-1]);
            if(i==tei||i-1==tei){sum[i]=1;}
            if(sum[i]>2){cout<<"No"<<endl;}
            else{cout<<"Yes"<<endl;}
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3964kb

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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

wrong answer 4th lines differ - expected: 'No', found: 'Yes'