1 条题解

  • 0
    @ 2025-7-5 10:45:39
    #include <bits/stdc++.h>
    using namespace std;
    bool flag[1000000 + 5];
    int main()
    {
        for (int x = 1; x <= 1000; x++)
            for (int y = 1; y <= 1000; y++)
            {
                int now = x * x + y * y;
                if (now <= 1000000)
                    flag[now] = true;
            }
        int n, x;
        cin >> n;
        while (n--)
        {
            cin >> x;
            if (flag[x])
                cout << "Yes\n";
            else
                cout << "No\n";
        }
        return 0;
    }
    
    • 1

    信息

    ID
    12192
    时间
    1000ms
    内存
    512MiB
    难度
    1
    标签
    递交数
    4
    已通过
    3
    上传者