1 solutions

  • 0
    @ 2025-6-6 19:58:12
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	int cnt=0;
    	for(int a=1;a<=n;a++)
    	{
    		for(int b=a;b<=n;b++)
    		{
    			for(int c=b;c<=n;c++)
    			{
    				if(a*a+b*b==c*c)
    				{
    					cnt++;
    				}
    			}
    		}
    	}
    	cout<<cnt;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    1174
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    8
    Accepted
    5
    Uploaded By