diff --git a/.vscode/settings.json b/.vscode/settings.json index 01faa21..e9f6b6e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,7 +24,8 @@ "vector": "cpp", "unordered_map": "cpp", "unordered_set": "cpp", - "string_view": "cpp" + "string_view": "cpp", + "cmath": "cpp" }, "terminal.integrated.automationShell.windows": "cmd.exe", "files.encoding": "gb18030", diff --git a/1598_roundfind_sushu/Readme.md b/1598_roundfind_sushu/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/1598_roundfind_sushu/Readme.md @@ -0,0 +1,3 @@ +# 标题 + +* 内容 \ No newline at end of file diff --git a/1598_roundfind_sushu/doc/Readme.md b/1598_roundfind_sushu/doc/Readme.md new file mode 100644 index 0000000..4e768b5 --- /dev/null +++ b/1598_roundfind_sushu/doc/Readme.md @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/1598_roundfind_sushu/doc/鍦嗙幆涓婃眰绱犳暟III.pdf b/1598_roundfind_sushu/doc/鍦嗙幆涓婃眰绱犳暟III.pdf new file mode 100644 index 0000000..4c9ca48 Binary files /dev/null and b/1598_roundfind_sushu/doc/鍦嗙幆涓婃眰绱犳暟III.pdf differ diff --git a/1598_roundfind_sushu/main.cpp b/1598_roundfind_sushu/main.cpp new file mode 100644 index 0000000..88ea141 --- /dev/null +++ b/1598_roundfind_sushu/main.cpp @@ -0,0 +1,81 @@ +#include +#include +using namespace std; +int n, k,a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 },allans=0; +bool ce[8]={0}; +bool pan(int n) +{ + int len = sqrt(n); + for (int i = 2; i <= len; i++) { + if (n % i == 0) { + return 0; + } + } + return 1; +} +void dg(int xian){ + if(xian>n){ + // for(int i=1;i<=n;i++){ + // cout<allans){ + allans=ans; + } + } + for(int i=2;i<=n;i++){ + if(ce[i]==0){ + a[xian]=i; + ce[i]=1; + dg(xian+1); + ce[i]=0; + } + } +} +int main() +{ + int now = 0, zong = 1, ans = 0; + cin >> n >> k; + if (k == 1) { + if (n == 1) { + cout << "0" << endl + << "0"; + } else { + int chu = 1; + for (int i = 3; i <= n; i+=2) { + chu++; + } + cout << chu << endl + << chu; + } + } else { + for (int i = n - k + 2; i <= n; i++) { + now *= 10; + now += a[i]; + zong *= 10; + } + for (int i = 1; i <= n; i++) { + now %= zong; + now *= 10; + now += a[i]; + ans += pan(now); + } + cout<