/ SeriousOJ /

Record Detail

Compile Error

foo.cs(2,0): error CS1024: Wrong preprocessor directive
foo.cs(3,0): error CS1525: Unexpected symbol `int'

Code

#include <stdio.h>

int main(){
    int x = 0, t;

    scanf("%d", &t);

    while(x < t){



        int n;

        scanf("%d", &n);

        int ara[n], ara2[n];

        for (int i = 0; i < n; i++){
            scanf("%d", &ara[i]);
        }

        int min, min_ind;

        for(int i = 0; i < n; i++){
            min = ara[i];
            for(int j = 0; j < n; j++){
                if(min >  ara[j]){
                    min = ara[j];
                    min_ind = j;
                }
            }
            ara2[i] = min;
            ara[min_ind] = 100000;
        }

        //printf("%d %d %d", ara2[0], ara2[1], ara2[2]);

        for(int i = 0; i < n; i++){
            if(ara2[i] != i+1){
                printf("NO\n");
                goto Down;
            }

        }
        printf("YES\n");

        Down:

        x++;

    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Contest
Brain Booster #3
Language
C# 7 (Mono 6.8)
Submit At
2024-05-06 15:29:41
Judged At
2024-11-11 03:34:14
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes