1 solutions

  • 1
    @ 2026-5-31 11:41:31
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,cnt=0;cin>>n;
        for(int i=1;i<=n;i++)
        {
            for(int j=i+1;j<=n;j++)
            {
                int t=sqrt(i*j);
                if(t*t==i*j) cnt++;
            }
        }
        cout<<cnt;
        return 0;
    }
    
    • 1

    Information

    ID
    53
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    161
    Accepted
    6
    Uploaded By