이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
unordered_map <int, set <int>> s;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
vector <int> d;
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
d.push_back(i);
if (i * i != n) {
d.push_back(n / i);
}
}
}
sort(d.begin(), d.end());
s[1].insert(0);
for (int x : d) {
if (x != 1) {
for (int y : d) {
if (x % y == 0) {
for (int v : s[x / y]) {
s[x].insert(v + y - 1);
}
}
}
}
}
cout << (int) s[n].size() << "\n";
for (int v : s[n]) {
cout << v << " ";
}
cout << "\n";
return 0;
}
# | 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... |