Compilation error "I dont know why !"

Правка en2, от Basel_Ahmed, 2022-11-19 00:55:57

why codeforcesgive me a compilation error while all other compile give me the write output?

[submission:181542252] [problem:R. Palindrome Array] ~~~~~

include<bits/stdc++.h>

using namespace std; int size; int pr=0,pl=0; void read(long long ar[], int s){ for (int i = 0; i < s; ++i) { cin>>ar[i]; pr++; } } void palindrome (long long ar[]){ if(pr==(size-1)/2){ cout<<"YES"; return; } if(ar[pl]==ar[pr-1]){ ++pl; --pr; return palindrome(ar); } else{ cout<<"NO"; return; } } int main () { cin>>size; long long array[size]; read(array,size); palindrome(array); return 0; }

include<bits/stdc++.h>

using namespace std; int size; int pr=0,pl=0; void read(long long ar[], int s){ for (int i = 0; i < s; ++i) { cin>>ar[i]; pr++; } } void palindrome (long long ar[]){ if(pr==(size-1)/2){ cout<<"YES"; return; } if(ar[pl]==ar[pr-1]){ ++pl; --pr; return palindrome(ar); } else{ cout<<"NO"; return; } } int main () { cin>>size; long long array[size]; read(array,size); palindrome(array); return 0; } ~~~~~ https://codeforces.me/group/MWSDmqGsZm/contest/223339/submission/181542252

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Basel_Ahmed 2022-11-19 00:57:19 584
en3 Английский Basel_Ahmed 2022-11-19 00:56:46 570
en2 Английский Basel_Ahmed 2022-11-19 00:55:57 1231
en1 Английский Basel_Ahmed 2022-11-19 00:51:04 189 Initial revision (published)