Help me in solving ENV problem

My issue

what is issue in this code

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int n;
	cin>>n;
	while(n--){
	    int m;
	    cin>>m;
	    vector<int>v;
	    for(int i=0;i<m;i++){
	        int ele;
	        cin>>ele;
	        v.push_back(ele);
	    }
	    sort(v.begin(),v.end());
	    int s=v[0];
	    for(int i=1;i<m;i++){
	        if(v[i]==1) s+=v[i];
	        else s*=v[i];
	    }
	    cout<<s<<endl;
	}

}

Problem Link: Encrypt Value Practice Coding Problem - CodeChef

@guptaabhi123
plzz refer my c++ code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    long long int a[n];
	    for(int i=0;i<n;i++)
	    {
	        cin>>a[i];
	    }
	    sort(a,a+n);
	    long long int ans=a[0];
	    for(int i=1;i<n;i++)
	    {
	        ans=max(ans+a[i],ans*a[i]);
	        ans=ans%1000000007;
	    }
	    cout<<ans<<endl;
	}
	return 0;
}