2 solutions

  • 0
    @ 2025-12-3 21:02:23
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	long long n,a,c=1;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		cin>>a;
    		c*=a;
    	}
    	if(c>1000000)
    	{
    		cout<<">"<<1000000;
    	}
    	else
    	{ 
    		cout<<c;
    	}
    	return 0;
    }
    
    • -1
      @ 2025-11-8 15:43:57
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n,a;
      	cin>>n;
      	long long s=1;
      	for(int i=1;i<=n;i++){
      		cin>>a;
      		s*=a;
      	}
      	if(s>1000000){
      		cout<<">1000000";
      	}else{
      		cout<<s;
      	}
      	return 0;
      }
      
      • 1

      Information

      ID
      2163
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      # Submissions
      50
      Accepted
      21
      Uploaded By