Submission #464298

#TimeUsernameProblemLanguageResultExecution timeMemory
464298osmanallazovToys (CEOI18_toy)C++14
100 / 100
605 ms4500 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll>pairll; typedef pair<ll,pairll>pairlll; typedef pair<pairll,pairll>pairllll; typedef long double ld; typedef pair<ll,string>pairls; #define INF 1000000000000007 #define pb push_back #define fr first #define sc second ll n; set<ll>res; void S(ll x, ll y,ll z){ for(int i=z;i*i<=x;i++){ if(x%i==0){ S(x/i,y+i-1,i); } } res.insert(y+x-1); return ; } int main() { cin>>n; S(n,0,2); cout<<res.size()<<endl; for(auto it:res){ cout<<it<<" "; } cout<<endl; 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...