# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
494338 | fcmalkcin | Toys (CEOI18_toy) | C++17 | 1871 ms | 4352 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")*/
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn=5e5+5;
const ll mod=1e9+7 ;
const ll base=3e18;
/// you will be the best but now you just are trash
/// goal 1/7
set<ll> st;
void dosth(ll n,ll a,ll l)
{
if (n==1)
{
st.insert(a);
return ;
}
for (int j=1;j*j<=n;j++)
{
if (n%j==0)
{
if (j>=l) dosth(n/j,a+j-1,j);
if (n/j>=l) dosth(j,a+n/j-1,n/j);
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
if (fopen("t.inp", "r"))
{
freopen("test.inp", "r", stdin);
freopen("test.out", "w", stdout);
}
ll n;
cin>> n;
dosth(n,0,2);
cout <<st.size()<<endl;
for (auto to:st)
{
cout <<to<<" ";
}
}
/*1
10 6
0 9 16
0 6 2
1 5 10 15
*/
컴파일 시 표준 에러 (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... |