| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 585009 | hibiki | Toys (CEOI18_toy) | C++11 | 5039 ms | 101984 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(x) (int)x.size()
int n;
set<int> sum[100005], ans;
void find(int nw, int add)
{
if(nw < 100005)
{
for(auto _: sum[nw])
ans.insert(add + _);
return ;
}
find(1, add + nw - 1);
for(int j = 2; j * j <= nw; j++)
{
if(n % j == 0)
{
int a = j;
int b = nw / j;
find(a, add + b - 1);
find(b, add + a - 1);
}
}
}
int main()
{
sum[1].insert(0);
for(int i = 2; i < 100005; i++)
{
for(int j = 1; j * j <= i; j++)
{
if(i % j == 0)
{
int a = j;
int b = i / j;
for(auto _: sum[b])
{
sum[i].insert(a - 1 + _);
}
for(auto _: sum[a])
{
sum[i].insert(b - 1 + _);
}
}
}
}
scanf("%d",&n);
find(n, 0);
printf("%d\n",sz(ans));
for(auto _: ans)
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... | ||||
