Code
#include<stdio.h>
int main (){
int test;
scanf("%d",&test);
for (int i = 0; i<test; i++){
int n;
int flag = 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");
flag = 1;
break;
}
}
for (int j=0; j<n; j++){
if (arr[j]!=n && flag==0){
printf("NO");
break;
}
}
printf("\n");
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1055 Array Permutation
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-05-10 20:55:00
- Judged At
- 2024-11-11 03:30:12
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 320.0 KiB