标签:set stdout targe ati 传送门 long 排列 cst using
这道题就暴力枚举好了,只要知道因子链的数量相当于不重复的全排列就行了(感觉自己写的好水啊)
CODE:
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,tot=0; long long ans=0; int a[31]; void chazhao(int x) { for(int i=2;i<=x;i++) { if((x%i)==0) { a[tot]=i; tot++; return chazhao(x/i); } } } int main() { freopen("factor.in","r",stdin); freopen("factor.out","w",stdout); cin>>n; chazhao(n); do { ans++; } while (next_permutation(a,a+tot)); cout<<tot<<" "<<ans; return 0; }
标签:set stdout targe ati 传送门 long 排列 cst using
原文地址:https://www.cnblogs.com/YYCether666/p/11372800.html