제출 #444724

#제출 시각아이디문제언어결과실행 시간메모리
444724definitelynotmeeToys (CEOI18_toy)C++98
59 / 100
5041 ms928 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; set<int> resp; void bt (int val, int cur, int sum){ resp.insert(val-1+sum); for(int i = cur; i <= sqrt(val); i++){ if(!(val%i)) bt(val/i,cur,sum+i-1); } } int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; 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...