So, I am facing a SIGEMT error while doing a ZCOPRAC problem [ZCO14003, Smart Phone], the code works as intended when I use it on geeksforgeeks ide but gives me the error when I use it on codechef ide.
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int T;
long long int N;
long long int Budget[N];
long long int price;
long long int point = floor(N/2);
long long int i = 0;
cin >> N;
for(i; i < N; i++)
cin >> Budget[i];
sort(Budget, Budget + N);
price = Budget[point + 1];
cout << price*(N - point - 1);
return 0;
}
Link to GFG code: Online Compiler and IDE - GeeksforGeeks
Please, can anyone help this poor novice?
EDIT: SOLVED!