# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
942762 | 2024-03-11T04:09:34 Z | vjudge1 | Toys (CEOI18_toy) | C++17 | 1 ms | 344 KB |
#include <bits/stdc++.h> #define int long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() using namespace std; signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n; cin>>n; vector <int> v;v.pb(0); for(int i=2;i*i<=n;i++){ while(n%i==0){ v.pb(i); n/=i; } } if(n>1)v.pb(n); vector <int> sum[v.size()]; sum[0].pb(0); for(int i=1;i<v.size();i++){ int x=v[i]; for(int j=i-1;j>=0;j--){ for(auto val : sum[j])sum[i].pb(x-1+val); x*=v[j]; } } sort(all(sum[v.size()-1])); int p=0; for(auto x : sum[v.size()-1]){ if(x!=p)cout<<x<<" "; p=x; } } /* */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |