QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#344007#7933. Build PermutationHuangHanShengCompile Error//C111.5kb2024-03-03 13:31:172024-03-03 13:31:17

Details

answer.code: In function ‘main’:
answer.code:13:5: error: variable-sized object may not be initialized
     int num[n]={};
     ^~~
answer.code:54:32: warning: passing argument 1 of ‘isUnique’ from incompatible pointer type [-Wincompatible-pointer-types]
     if(index==n-1 &&  isUnique(array,num,n)==1)
                                ^~~~~
answer.code:4:25: note: expected ‘long long int *’ but argument is of type ‘int *’
 int isUnique(long long *arr, long long *num, long long n);
              ~~~~~~~~~~~^~~
answer.code:54:38: warning: passing argument 2 of ‘isUnique’ from incompatible pointer type [-Wincompatible-pointer-types]
     if(index==n-1 &&  isUnique(array,num,n)==1)
                                      ^~~
answer.code:4:41: note: expected ‘long long int *’ but argument is of type ‘int *’
 int isUnique(long long *arr, long long *num, long long n);
                              ~~~~~~~~~~~^~~
answer.code: At top level:
answer.code:61:5: error: conflicting types for ‘isUnique’
 int isUnique(int*arr, int *num, int n)
     ^~~~~~~~
answer.code:4:5: note: previous declaration of ‘isUnique’ was here
 int isUnique(long long *arr, long long *num, long long n);
     ^~~~~~~~
answer.code: In function ‘isUnique’:
answer.code:63:5: error: variable-sized object may not be initialized
     int temp_arr[n] = {}, temp_num[n] = {};
     ^~~
answer.code:63:5: error: variable-sized object may not be initialized
answer.code: In function ‘main’:
answer.code:10:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ^~~~~~~~~~~~~~
answer.code:15:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&array[i]);
         ^~~~~~~~~~~~~~~~~~~~~