Submission #142911

#TimeUsernameProblemLanguageResultExecution timeMemory
142911IC_COLDSTOPToys (CEOI18_toy)C++17
100 / 100
3485 ms71432 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long //#define int ll #define MP make_pair #define pb push_back #define F first #define S second #define REP(i,a,b) for(int i=a; i<b; i++) #define pii pair<int,int> const int MX=1e5+3, mod=1e9+7; int n; set<int> st; unordered_map<int,int> mark[MX]; void ANS(int u, int v){ if(mark[v][u]) return; mark[v][u]=1; st.insert(u-1+v); for(int i=2; i<=sqrt(u); i++) if(u%i==0) ANS(u/i, v+i-1); } int32_t main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n; ANS(n,0); cout<<st.size()<<endl; for(auto u:st) cout<<u<<" "; 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...