1 solutions

  • 0
    @ 2025-12-3 16:12:49

    C++ :

    #include<iostream>
    using namespace std;
    int main()
    {
    	int max,min,a,b=0,c=0,d=0,e=0;
    	cin>>a>>b>>c;
    	if (a>b)
    	{
    	max=a;
    	min=b;	
    	}
    	else
    	{
    	max=b;
    	min=a;	
    	}
        for (int i=0;i<c;i++)
        {
        	cin>>d;
        	if (a+b>d&min+d>max)
        	{
        	e++;
        	}
        }
        cout<<e<<endl;
    }
    
    • 1

    Information

    ID
    830
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    4
    Accepted
    4
    Uploaded By