Code
#include<stdio.h>
int main (){
int test;
scanf("%d",&test);
for (int i = 0; i<test; i++){
int n;
int cntt = 0;
scanf("%d",&n);
int arr[n];
for (int j=0; j<n; j++){
scanf("%d",&arr[j]);
}
for (int j=0; j<n; j++){
if (arr[j]==n){
printf("YES");
cntt = 1;
break;
}
}
for (int j=0; j<n; j++){
if (arr[j]!=n && cntt==0){
printf("NO");
break;
}
}
printf("\n");
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1055 Array Permutation
- Contest
- Brain Booster #3
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-05-06 17:01:38
- Judged At
- 2024-11-11 03:32:38
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 388.0 KiB