| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1352319 | truongthaiduonglaptrinh | Toys (CEOI18_toy) | C++20 | 1398 ms | 86748 KiB |
// duonglaptrinh
# include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
map<int, set<int>> luu;
void trau(int n) {
if(luu[n].size()) {
return;
}
luu[n].insert(n - 1);
for(int i = 2; i * i <= n; i++) {
if(n % i == 0) {
int j = n / i;
trau(i);
for(int x : luu[i]) {
luu[n].insert(x + j - 1);
}
if(j != i) {
trau(j);
for(int x : luu[j]) {
luu[n].insert(x + i - 1);
}
}
}
}
}
int n;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>n;
luu[1].insert(0);
trau(n);
cout<<luu[n].size()<<"\n";
for(int x : luu[n]) {
cout<<x<<" ";
}
return 0;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
