/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 0ms 324.0 KiB
#2 Wrong Answer 1ms 324.0 KiB

Code

#include<stdio.h>
int main(){
    int t;
    scanf("%d",&t);
    for(int i=0; i<t; i++){
        int n;
        int count=0;
        int sum = 0;
        int num_sum = 0;
        scanf("%d",&n);
        int arr[n];
        for(int j=0; j<n; j++){
            scanf("%d",&arr[j]);
        }
        for(int j=0; j<n-1; j++){
            for(int k=j+1; k<n; k++){
                if(arr[j]==arr[k]){
                    count++;
                }

            }
        }
        for(int m=1; m<n+1; m++){
            num_sum+=m;
        }
        for(int m=0; m<n; m++){
            sum+=arr[m];
        }
        if(count==0 && sum==num_sum){
            printf("YES");
        }else{
            printf("NO");
        }
        // printf("%d",count);
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Contest
Brain Booster #3
Language
C99 (GCC 13.2.0)
Submit At
2024-05-06 16:02:40
Judged At
2024-11-11 03:33:28
Judged By
Score
0
Total Time
1ms
Peak Memory
324.0 KiB