This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector,Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef complex<ld> cpx;
const ll N=2e5+5;
const ll MOD=1e9+7;
const ll INF=(1LL<<58);
const ld pi=acos(-1);
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define ALL(_a) _a.begin(),_a.end()
#define lwb lower_bound
#define SZ(_a) (ll)_a.size()
ll n;
vector<ll> lis;
void split(ll k){
for(ll i=1;i*i<=k;i++){
if(k%i==0){
lis.pb(n/k-1+i-1+k/i-1);
}
}
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n;
for(ll i=1;i*i<=n;i++){
if(n%i==0){
split(i);
split(n/i);
}
}
sort(lis.begin(),lis.end());
lis.erase(unique(lis.begin(),lis.end()),lis.end());
cout<<SZ(lis)<<"\n";
REP(i,SZ(lis))cout<<lis[i]<<" \n"[i==SZ(lis)-1];
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... |