# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
585016 | hibiki | Toys (CEOI18_toy) | C++11 | 1990 ms | 86640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(x) (int)x.size()
int n;
map<int, set<int> > mp;
void find(int nw)
{
if(mp.count(nw))
return ;
mp[nw].insert(nw - 1);
for(int j = 2; j * j <= nw; j++)
{
if(nw % j == 0)
{
int a = j;
int b = nw / j;
find(a);
for(auto _: mp[a])
mp[nw].insert(b - 1 + _);
find(b);
for(auto _: mp[b])
mp[nw].insert(a - 1 + _);
}
}
// printf("%d\n",nw);
// for(auto _: mp[nw])
// printf("%d ",_);
// printf("\n");
}
int main()
{
mp[1].insert(0);
mp[2].insert(1);
scanf("%d",&n);
find(n);
printf("%d\n",sz(mp[n]));
for(auto _: mp[n])
printf("%d ",_);
printf("\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |