# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
112394 |
2019-05-19T12:40:25 Z |
reda |
Toys (CEOI18_toy) |
C++14 |
|
7 ms |
5120 KB |
#include <bits/stdc++.h>
#define MAXN 100005
using namespace std;
set<int> dp[MAXN];
set<int> summerg(set<int> S,set<int> T)
{
set<int> ans;
for(auto a : S)
for(auto b : T)
ans.insert(a+b);
return ans;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for(int i = 2; i <= n; i++)
{
for(int j = 2; j*j <= i; j++)
{
if(i % j == 0)
{
auto x = summerg(dp[j],dp[i / j]);
dp[i].insert(x.begin(),x.end());
}
}
dp[i].insert(i-1);
}
cout<<dp[n].size()<<endl;
for(auto x:dp[n])
cout<<x<< ' ';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
5120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
5120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
5120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
5120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
5120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |