文章

93

粉丝

56

获赞

284

访问

37.8k

头像
完数 题解:暴力
P1046 兰州大学机试题
发布于2025年3月23日 17:10
阅读数 295

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    for(int i=6;i<=n;i++)
    {
        set<int> s;
        s.insert(1);
        for(int j=2;j<=sqrt(i)+1;j++)
        {
            if(i%j==0)
            {
                s.insert(j);
                s.insert(i/j);
            }
        }
        int ans=0;
        for(auto it=s.begin();it!=s.end();it++)
       &nb...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发