제출 #444717

#제출 시각아이디문제언어결과실행 시간메모리
444717definitelynotmeeToys (CEOI18_toy)C++98
59 / 100
5076 ms964 KiB
#include<bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INFL = (1LL<<62)-1;
const int INF = (1<<30)-1;
const double EPS = 1e-7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6+1;



int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    set<int> resp;
    function<void(ll,ll,ll)> bt =[&](ll val, ll cur, ll sum){
            
        for(int i = cur; i*i <= val; i++){
            if(val%i == 0)
                bt(val/i,cur,sum+i-1);
        }

        resp.insert(val-1+sum);
    };
    bt(n,2,0);
    cout << resp.size() << '\n';
    for(int i : resp)
        cout << i << ' ';
    cout << '\n';
    return 0;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...