From 10a127cebf2ada322f916161f5ebefdecddd8498 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 5 Nov 2022 19:42:56 +0800 Subject: [PATCH] =?UTF-8?q?#1732.=20=E3=80=90NOIP=202022=20=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E8=B5=9B=20by=20AzusaCat=E3=80=91=E5=B0=8F=E9=BB=84?= =?UTF-8?q?=E9=B8=AD=E4=B8=8E=E7=9F=A9=E9=98=B5=EF=BC=88matrix=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sjzezoj.com/submission/63545 --- S2OJ/1732/1732.cpp | 28 ++++++++++++++++++++++++++++ S2OJ/1732/data/ex_matrix1.ans | 3 +++ S2OJ/1732/data/ex_matrix1.in | 3 +++ S2OJ/1732/data/ex_matrix2.ans | 3 +++ S2OJ/1732/data/ex_matrix2.in | 3 +++ S2OJ/1732/data/ex_matrix3.ans | 3 +++ S2OJ/1732/data/ex_matrix3.in | 3 +++ S2OJ/1732/data/matrix1.ans | 3 +++ S2OJ/1732/data/matrix1.in | 3 +++ S2OJ/1732/data/matrix10.ans | 3 +++ S2OJ/1732/data/matrix10.in | 3 +++ S2OJ/1732/data/matrix2.ans | 3 +++ S2OJ/1732/data/matrix2.in | 3 +++ S2OJ/1732/data/matrix3.ans | 3 +++ S2OJ/1732/data/matrix3.in | 3 +++ S2OJ/1732/data/matrix4.ans | 3 +++ S2OJ/1732/data/matrix4.in | 3 +++ S2OJ/1732/data/matrix5.ans | 3 +++ S2OJ/1732/data/matrix5.in | 3 +++ S2OJ/1732/data/matrix6.ans | 3 +++ S2OJ/1732/data/matrix6.in | 3 +++ S2OJ/1732/data/matrix7.ans | 3 +++ S2OJ/1732/data/matrix7.in | 3 +++ S2OJ/1732/data/matrix8.ans | 3 +++ S2OJ/1732/data/matrix8.in | 3 +++ S2OJ/1732/data/matrix9.ans | 3 +++ S2OJ/1732/data/matrix9.in | 3 +++ S2OJ/1732/data/problem.conf | 3 +++ 28 files changed, 109 insertions(+) create mode 100644 S2OJ/1732/1732.cpp create mode 100644 S2OJ/1732/data/ex_matrix1.ans create mode 100644 S2OJ/1732/data/ex_matrix1.in create mode 100644 S2OJ/1732/data/ex_matrix2.ans create mode 100644 S2OJ/1732/data/ex_matrix2.in create mode 100644 S2OJ/1732/data/ex_matrix3.ans create mode 100644 S2OJ/1732/data/ex_matrix3.in create mode 100644 S2OJ/1732/data/matrix1.ans create mode 100644 S2OJ/1732/data/matrix1.in create mode 100644 S2OJ/1732/data/matrix10.ans create mode 100644 S2OJ/1732/data/matrix10.in create mode 100644 S2OJ/1732/data/matrix2.ans create mode 100644 S2OJ/1732/data/matrix2.in create mode 100644 S2OJ/1732/data/matrix3.ans create mode 100644 S2OJ/1732/data/matrix3.in create mode 100644 S2OJ/1732/data/matrix4.ans create mode 100644 S2OJ/1732/data/matrix4.in create mode 100644 S2OJ/1732/data/matrix5.ans create mode 100644 S2OJ/1732/data/matrix5.in create mode 100644 S2OJ/1732/data/matrix6.ans create mode 100644 S2OJ/1732/data/matrix6.in create mode 100644 S2OJ/1732/data/matrix7.ans create mode 100644 S2OJ/1732/data/matrix7.in create mode 100644 S2OJ/1732/data/matrix8.ans create mode 100644 S2OJ/1732/data/matrix8.in create mode 100644 S2OJ/1732/data/matrix9.ans create mode 100644 S2OJ/1732/data/matrix9.in create mode 100644 S2OJ/1732/data/problem.conf diff --git a/S2OJ/1732/1732.cpp b/S2OJ/1732/1732.cpp new file mode 100644 index 00000000..adf72cf2 --- /dev/null +++ b/S2OJ/1732/1732.cpp @@ -0,0 +1,28 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n, k; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n >> k; + + int a = n / k, + b = (n - 1) / k + 1; + int cb = n % k, + ca = k - n % k; + long long res = 0; + + res += static_cast(ca) * (ca - 1) / 2 * a * a; + res += static_cast(cb) * (cb - 1) / 2 * b * b; + res += static_cast(a) * b * ca * cb; + + cout << res << endl; + + return 0; +} diff --git a/S2OJ/1732/data/ex_matrix1.ans b/S2OJ/1732/data/ex_matrix1.ans new file mode 100644 index 00000000..38118f32 --- /dev/null +++ b/S2OJ/1732/data/ex_matrix1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3 +size 2 diff --git a/S2OJ/1732/data/ex_matrix1.in b/S2OJ/1732/data/ex_matrix1.in new file mode 100644 index 00000000..d28bc50a --- /dev/null +++ b/S2OJ/1732/data/ex_matrix1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ece3d232c1ca9ef8a80b6fdb1585b8f5cf653b9dd023b0521c8da64db859ffac +size 4 diff --git a/S2OJ/1732/data/ex_matrix2.ans b/S2OJ/1732/data/ex_matrix2.ans new file mode 100644 index 00000000..cb90f684 --- /dev/null +++ b/S2OJ/1732/data/ex_matrix2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06e9d52c1720fca412803e3b07c4b228ff113e303f4c7ab94665319d832bbfb7 +size 2 diff --git a/S2OJ/1732/data/ex_matrix2.in b/S2OJ/1732/data/ex_matrix2.in new file mode 100644 index 00000000..e3f700f7 --- /dev/null +++ b/S2OJ/1732/data/ex_matrix2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237a7d5ea530b2b0aecd49e3bcdc802433803f886596b1305cc2284a7017eb70 +size 5 diff --git a/S2OJ/1732/data/ex_matrix3.ans b/S2OJ/1732/data/ex_matrix3.ans new file mode 100644 index 00000000..ab59786a --- /dev/null +++ b/S2OJ/1732/data/ex_matrix3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13dc5b1235df9346a2b3a0b96beed66b56ec3cde8b1e4fd36182c29ee58fad06 +size 6 diff --git a/S2OJ/1732/data/ex_matrix3.in b/S2OJ/1732/data/ex_matrix3.in new file mode 100644 index 00000000..3e56c211 --- /dev/null +++ b/S2OJ/1732/data/ex_matrix3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26784ca342094919d894c04f68c23937fc202777300178c870785c69a3bae0de +size 6 diff --git a/S2OJ/1732/data/matrix1.ans b/S2OJ/1732/data/matrix1.ans new file mode 100644 index 00000000..ca267b30 --- /dev/null +++ b/S2OJ/1732/data/matrix1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2 +size 2 diff --git a/S2OJ/1732/data/matrix1.in b/S2OJ/1732/data/matrix1.in new file mode 100644 index 00000000..1bfb6338 --- /dev/null +++ b/S2OJ/1732/data/matrix1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc5d2d11308095caf8af640e8e21f98ccda8ec54ec98681d7923e07afd3ec33 +size 4 diff --git a/S2OJ/1732/data/matrix10.ans b/S2OJ/1732/data/matrix10.ans new file mode 100644 index 00000000..f415baf7 --- /dev/null +++ b/S2OJ/1732/data/matrix10.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50b9585545a9acbc363473254848bbf13ca40a1d6ce496b374db069301abd3da +size 19 diff --git a/S2OJ/1732/data/matrix10.in b/S2OJ/1732/data/matrix10.in new file mode 100644 index 00000000..d7cf28c8 --- /dev/null +++ b/S2OJ/1732/data/matrix10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58eb56494ef10849e1b81020dfe210341d7c03ff1c009c5e2aa02da4ee248a94 +size 20 diff --git a/S2OJ/1732/data/matrix2.ans b/S2OJ/1732/data/matrix2.ans new file mode 100644 index 00000000..cb90f684 --- /dev/null +++ b/S2OJ/1732/data/matrix2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06e9d52c1720fca412803e3b07c4b228ff113e303f4c7ab94665319d832bbfb7 +size 2 diff --git a/S2OJ/1732/data/matrix2.in b/S2OJ/1732/data/matrix2.in new file mode 100644 index 00000000..e3f700f7 --- /dev/null +++ b/S2OJ/1732/data/matrix2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237a7d5ea530b2b0aecd49e3bcdc802433803f886596b1305cc2284a7017eb70 +size 5 diff --git a/S2OJ/1732/data/matrix3.ans b/S2OJ/1732/data/matrix3.ans new file mode 100644 index 00000000..f4808fee --- /dev/null +++ b/S2OJ/1732/data/matrix3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:917df3320d778ddbaa5c5c7742bc4046bf803c36ed2b050f30844ed206783469 +size 3 diff --git a/S2OJ/1732/data/matrix3.in b/S2OJ/1732/data/matrix3.in new file mode 100644 index 00000000..db54d38a --- /dev/null +++ b/S2OJ/1732/data/matrix3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02939f47ad187c7a6a3c3ce94a9d169e2713aa6ab2095f5d046964fbfe77571d +size 12 diff --git a/S2OJ/1732/data/matrix4.ans b/S2OJ/1732/data/matrix4.ans new file mode 100644 index 00000000..3e3e6c83 --- /dev/null +++ b/S2OJ/1732/data/matrix4.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e6e6248478ea559eb6bc74139468ca4d2733444c763afbb96651a45fe51e1b8 +size 6 diff --git a/S2OJ/1732/data/matrix4.in b/S2OJ/1732/data/matrix4.in new file mode 100644 index 00000000..87087b9a --- /dev/null +++ b/S2OJ/1732/data/matrix4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24cbc55cd4f06412087dce489cdd725be692762bac98bd0a95efb4a22ac08bb0 +size 6 diff --git a/S2OJ/1732/data/matrix5.ans b/S2OJ/1732/data/matrix5.ans new file mode 100644 index 00000000..add451a7 --- /dev/null +++ b/S2OJ/1732/data/matrix5.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de75584b727318ea9ef1be09fccd07fbdcfd7eed4320fbb334bdfeeb8f27b635 +size 6 diff --git a/S2OJ/1732/data/matrix5.in b/S2OJ/1732/data/matrix5.in new file mode 100644 index 00000000..92e33606 --- /dev/null +++ b/S2OJ/1732/data/matrix5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a10c6ea3b6e306706328e54028f4019a37104fca4fdf08a20c9850c0d677b8f +size 6 diff --git a/S2OJ/1732/data/matrix6.ans b/S2OJ/1732/data/matrix6.ans new file mode 100644 index 00000000..45d1a9b0 --- /dev/null +++ b/S2OJ/1732/data/matrix6.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d01d2391cc87bd375c02d99f32d5cbfa7dc5751ae1cd9d41b73a0fe02e8deea +size 19 diff --git a/S2OJ/1732/data/matrix6.in b/S2OJ/1732/data/matrix6.in new file mode 100644 index 00000000..a39d6e34 --- /dev/null +++ b/S2OJ/1732/data/matrix6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bfa3d6e2101977477ea982afd35370b477664c68f0bc3a5e983f085586e12fd +size 12 diff --git a/S2OJ/1732/data/matrix7.ans b/S2OJ/1732/data/matrix7.ans new file mode 100644 index 00000000..1658cf0b --- /dev/null +++ b/S2OJ/1732/data/matrix7.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5175629e95acef75390b1a57948e9d2f93746bd7843ecd41524064c7010232c5 +size 19 diff --git a/S2OJ/1732/data/matrix7.in b/S2OJ/1732/data/matrix7.in new file mode 100644 index 00000000..a8978fff --- /dev/null +++ b/S2OJ/1732/data/matrix7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51c37beae848c93d20c69274b6f29682b1606675e6975a8cefde1eb23ecf4854 +size 12 diff --git a/S2OJ/1732/data/matrix8.ans b/S2OJ/1732/data/matrix8.ans new file mode 100644 index 00000000..0c09460c --- /dev/null +++ b/S2OJ/1732/data/matrix8.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:160b600835633da0a943d5d59b50a7291c80dbba7f13c965cbeb3241fe2ff3c8 +size 19 diff --git a/S2OJ/1732/data/matrix8.in b/S2OJ/1732/data/matrix8.in new file mode 100644 index 00000000..a89da1cc --- /dev/null +++ b/S2OJ/1732/data/matrix8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b00c49545d1046ab101cb3255fc095c6e8cf17d0f9c6b9b00ca3aebce7e7504d +size 19 diff --git a/S2OJ/1732/data/matrix9.ans b/S2OJ/1732/data/matrix9.ans new file mode 100644 index 00000000..c957a20d --- /dev/null +++ b/S2OJ/1732/data/matrix9.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d25e73b568640103a8f13b3b188f6f863177a1e9d21ec69a2223b6c5d3df28c +size 19 diff --git a/S2OJ/1732/data/matrix9.in b/S2OJ/1732/data/matrix9.in new file mode 100644 index 00000000..dbe802bb --- /dev/null +++ b/S2OJ/1732/data/matrix9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e775f3e8af422fdff8046dedf3ba869ce7d178f06074499e2927999ef7894864 +size 17 diff --git a/S2OJ/1732/data/problem.conf b/S2OJ/1732/data/problem.conf new file mode 100644 index 00000000..b842dd93 --- /dev/null +++ b/S2OJ/1732/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c278aee5b865665b0575a4f4604bb513a08b972e61baef8f052d5f4d144b1d03 +size 181