Submission #444715

#TimeUsernameProblemLanguageResultExecution timeMemory
444715definitelynotmeeToys (CEOI18_toy)C++98
59 / 100
5059 ms1020 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(int,int,int)> bt =[&](int val, int cur, int 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...