From 13a5e3e51f87f9c9ef01fb0bc75722bdbc54957b Mon Sep 17 00:00:00 2001 From: Thouser <2460657655@qq.com> Date: Fri, 13 Oct 2023 06:56:27 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=95=99=E7=A8=8B=E7=AC=AC=E4=B8=80=E7=AB=A0=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\244\346\225\260\344\271\213\345\222\214.cpp" | 14 ++++++++++++++ ...3\255\346\225\264\346\225\260\345\222\214.cpp" | 4 ++++ ...5\260\347\232\204\344\270\252\346\225\260.cpp" | 8 ++++++++ ...5\260\347\273\204\347\232\204\345\222\214.cpp" | 15 +++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 "\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" create mode 100644 "\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" create mode 100644 "\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" create mode 100644 "\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" diff --git "a/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" new file mode 100644 index 00000000..a46398c0 --- /dev/null +++ "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" @@ -0,0 +1,14 @@ +class Solution { +public: + vector twoSum(vector& nums, int target) { + int n = nums.size(); + for (int i = 0; i < n; ++i) { + for (int j = i + 1; j < n; ++j) { + if (nums[i] + nums[j] == target) { + return {i, j}; + } + } + } + return {}; + } +}; \ No newline at end of file diff --git "a/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" new file mode 100644 index 00000000..0af3eb23 --- /dev/null +++ "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" @@ -0,0 +1,4 @@ +add(long n) +{ + return n*(n+1)/2; +} diff --git "a/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" new file mode 100644 index 00000000..d01f1747 --- /dev/null +++ "b/\346\225\260\346\215\256\344\270\216\347\273\223\346\236\204\346\225\231\347\250\213/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" @@ -0,0 +1,8 @@ +bool primel(long n) +{ + long i; + for (i=2;i Date: Fri, 13 Oct 2023 06:56:33 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=95=99=E7=A8=8B=E7=AC=AC=E4=B8=80=E7=AB=A0=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- Gitee From 64c0ad4edb608e81e36399e048c9deda5b633097 Mon Sep 17 00:00:00 2001 From: Thouser <2460657655@qq.com> Date: Fri, 13 Oct 2023 06:56:36 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=95=99=E7=A8=8B=E7=AC=AC=E4=B8=80=E7=AB=A0=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- Gitee From 7488f9144fe227b1507de34fed9bbe2bca5eb85a Mon Sep 17 00:00:00 2001 From: Thouser <2460657655@qq.com> Date: Fri, 13 Oct 2023 07:15:57 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=AB=A0=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\244\346\225\260\344\271\213\345\222\214.cpp" | 14 ++++++++++++++ ...3\255\346\225\264\346\225\260\345\222\214.cpp" | 4 ++++ ...5\260\347\232\204\344\270\252\346\225\260.cpp" | 8 ++++++++ ...5\260\347\273\204\347\232\204\345\222\214.cpp" | 15 +++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 "2224020105/\347\254\254\344\270\200\347\253\240/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" create mode 100644 "2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" create mode 100644 "2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" create mode 100644 "2224020105/\347\254\254\344\270\200\347\253\240/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" diff --git "a/2224020105/\347\254\254\344\270\200\347\253\240/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" "b/2224020105/\347\254\254\344\270\200\347\253\240/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" new file mode 100644 index 00000000..a46398c0 --- /dev/null +++ "b/2224020105/\347\254\254\344\270\200\347\253\240/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" @@ -0,0 +1,14 @@ +class Solution { +public: + vector twoSum(vector& nums, int target) { + int n = nums.size(); + for (int i = 0; i < n; ++i) { + for (int j = i + 1; j < n; ++j) { + if (nums[i] + nums[j] == target) { + return {i, j}; + } + } + } + return {}; + } +}; \ No newline at end of file diff --git "a/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" "b/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" new file mode 100644 index 00000000..0af3eb23 --- /dev/null +++ "b/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2141-1\357\274\232\346\261\2021~n\347\232\204\350\277\236\347\273\255\346\225\264\346\225\260\345\222\214.cpp" @@ -0,0 +1,4 @@ +add(long n) +{ + return n*(n+1)/2; +} diff --git "a/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" "b/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" new file mode 100644 index 00000000..d01f1747 --- /dev/null +++ "b/2224020105/\347\254\254\344\270\200\347\253\240/\345\256\236\351\252\2143\357\274\232\346\261\202\347\264\240\346\225\260\347\232\204\344\270\252\346\225\260.cpp" @@ -0,0 +1,8 @@ +bool primel(long n) +{ + long i; + for (i=2;i