Wrong Answer
Code
#include <stdio.h>
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int a;
scanf("%d", &a);
int arr[a];
int check[a];
for (int i = 0; i < a; i++)
{
scanf("%d", &arr[i]);
if (arr[i] >= 1 && arr[i] <= a)
check[arr[i] - 1] = 1;
}
int yes = 1;
for (int i = 0; i < a; i++)
{
if (check[i] != 1)
{
yes = 0;
break;
}
}
if (yes == 1)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1055 Array Permutation
- Contest
- Brain Booster #3
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-05-06 15:29:31
- Judged At
- 2024-11-11 03:34:14
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 324.0 KiB