diff --git a/HDOJ/1016_autoAC.cpp b/HDOJ/1016_autoAC.cpp new file mode 100644 index 0000000..6b95d52 --- /dev/null +++ b/HDOJ/1016_autoAC.cpp @@ -0,0 +1,54 @@ +#include +#include +#include +using namespace std; +int ans[25]; +int f[25]; +int n; +int isprime(int x) +{ + for(int i=2;i<=x/2;i++) + { + if(x%i==0) + return 0; + } + return 1; +} +void dfs(int k,int now) +{ + if(k==n) + { + if(isprime(now+1)) + { + ans[k]=now; + for(int i=0;i