# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1103934 | 2024-10-22T09:36:35 Z | ezzzay | Toys (CEOI18_toy) | C++14 | 1 ms | 336 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back int m,n; vector<int>vc; vector<int>st; void fun(int x, int p, int k){ if(x==1){ st.pb(k); return; } for(int i=p;i<vc.size();i++){ if(x%vc[i]==0){ fun(x/vc[i],i,k+vc[i]-1); } } } signed main(){ cin>>n; set<int>ts; for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ ts.insert(i); ts.insert(n/i); } } for(auto a:ts)vc.pb(a); fun(n,0,0); st.pb(n-1); sort(st.begin(),st.end()); cout<<st.size()<<endl; for(auto a:st)cout<<a<<" "; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |