# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
267157 | ly20 | Toys (CEOI18_toy) | C++17 | 5067 ms | 712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
set <int> resp;
void backt(int at, int tot) {
//printf("%d\n", at);
int sq = min((int) sqrt(at) + 10, at);
if(at == 1) {
resp.insert(tot);
return;
}
for(int i = 2; i < sq; i++) {
if(at % i == 0) {
backt(at / i, tot + i - 1);
backt(i, tot + at / i - 1);
}
}
backt(1, tot + at - 1);
}
int main() {
int n;
scanf("%d", &n);
backt(n, 0);
set <int> :: iterator it;
printf("%d\n", resp.size());
for(it = resp.begin(); it != resp.end(); it++) {
printf("%d ", *it);
}
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... |