| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 600127 | gary940610 | Toys (CEOI18_toy) | C++14 | 1575 ms | 33328 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#define pb push_back
#define pii pair<int, int>
#define tup tuple<int, int, int>
#define g0 get<0>(i)
#define g1 get<1>(i)
#define g2 get<2>(i)
#define f first
#define s second
#define lowbit(x) (x & -x)
#define endl '\n'
#define i1 (i << 1)
#define i2 (i << 1 | 1)
#define Hash(x, y) (maxn * x + y)
#define iofaster ios::sync_with_stdio(0);cin.tie(0)
#define fr(a) freopen((a), "r", stdin)
#define fw(a) freopen((a), "w", stdout)
#define mset(a, b) memset(a, b, sizeof(a))
#define all(x) x.begin(), x.end()
#define int long long
#define double long double
#pragma GCCoptimize("Ofast")
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 2e18 + 9;
const int mxn = 1e9;
const double eps = 1e-7;
vector<int> arr;
void dfs(int prv, int ans, int rem) {
if(rem == 1) {
arr.pb(ans);
return ;
}
for(int i = 1; i * i <= rem; i++) {
if(rem % i == 0) {
if(i >= prv) dfs(i, ans + i - 1, rem / i);
if(rem / i >= prv) dfs(rem / i, ans + rem / i - 1, i);
}
}
}
signed main() {
iofaster;
int n;
cin >> n;
dfs(2, 0, n);
sort(all(arr));
arr.resize(unique(all(arr)) - arr.begin());
cout << arr.size() << endl;
for(auto i: arr) cout << i << ' ';
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
