Is there any problem with codechef compiler?

I build up this code for the practice problem Chef and SnackDown(895). the code seems fine and running on ideone(link below) but it’s not working on Codechef properly.

#include
using namespace std;

int snackYear[5]={2010, 2015, 2016, 2017, 2019};

bool snckYear(int year){
for(int i=0;i<5;i++){
if(snackYear[i]==year){
return true;
}
return false;
}
}

int main() {
int t;
cin>>t;
while(t–){
int year;
cin>>year;
if(snckYear(year))
cout<<“HOSTED”<<endl;
else
cout<<“NOT HOSTED”<<endl;
}
return 0;
}

Ideone code