From 6c1c09faf269e1972febb54c89e7a967b5a07921 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Thu, 22 Dec 2022 21:51:27 +0800 Subject: [PATCH] =?UTF-8?q?1041.=20[HAOI2008]=E5=9C=86=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E6=95=B4=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://hydro.ac/d/bzoj/record/63a460bccf75a716a1673b8f --- BZOJ/1041/1041.cpp | 35 +++++++++++++++++++++++++++++++++++ BZOJ/1041/data/1.in | 3 +++ BZOJ/1041/data/1.out | 3 +++ BZOJ/1041/data/10.in | 3 +++ BZOJ/1041/data/10.out | 3 +++ BZOJ/1041/data/2.in | 3 +++ BZOJ/1041/data/2.out | 3 +++ BZOJ/1041/data/3.in | 3 +++ BZOJ/1041/data/3.out | 3 +++ BZOJ/1041/data/4.in | 3 +++ BZOJ/1041/data/4.out | 3 +++ BZOJ/1041/data/5.in | 3 +++ BZOJ/1041/data/5.out | 3 +++ BZOJ/1041/data/6.in | 3 +++ BZOJ/1041/data/6.out | 3 +++ BZOJ/1041/data/7.in | 3 +++ BZOJ/1041/data/7.out | 3 +++ BZOJ/1041/data/8.in | 3 +++ BZOJ/1041/data/8.out | 3 +++ BZOJ/1041/data/9.in | 3 +++ BZOJ/1041/data/9.out | 3 +++ 21 files changed, 95 insertions(+) create mode 100644 BZOJ/1041/1041.cpp create mode 100644 BZOJ/1041/data/1.in create mode 100644 BZOJ/1041/data/1.out create mode 100644 BZOJ/1041/data/10.in create mode 100644 BZOJ/1041/data/10.out create mode 100644 BZOJ/1041/data/2.in create mode 100644 BZOJ/1041/data/2.out create mode 100644 BZOJ/1041/data/3.in create mode 100644 BZOJ/1041/data/3.out create mode 100644 BZOJ/1041/data/4.in create mode 100644 BZOJ/1041/data/4.out create mode 100644 BZOJ/1041/data/5.in create mode 100644 BZOJ/1041/data/5.out create mode 100644 BZOJ/1041/data/6.in create mode 100644 BZOJ/1041/data/6.out create mode 100644 BZOJ/1041/data/7.in create mode 100644 BZOJ/1041/data/7.out create mode 100644 BZOJ/1041/data/8.in create mode 100644 BZOJ/1041/data/8.out create mode 100644 BZOJ/1041/data/9.in create mode 100644 BZOJ/1041/data/9.out diff --git a/BZOJ/1041/1041.cpp b/BZOJ/1041/1041.cpp new file mode 100644 index 00000000..849ece35 --- /dev/null +++ b/BZOJ/1041/1041.cpp @@ -0,0 +1,35 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + long long r, ans = 1; + + cin >> r; + + for (int i = 2; i * i <= r; i++) { + if (r % i == 0) { + int cnt = 0; + + while (r % i == 0) { + r /= i; + cnt++; + } + + if (i % 4 == 1) ans *= cnt * 2 + 1; + } + } + + if (r != 1 && r % 4 == 1) { + ans *= 3; + } + + cout << ans * 4 << endl; + + return 0; +} diff --git a/BZOJ/1041/data/1.in b/BZOJ/1041/data/1.in new file mode 100644 index 00000000..b97d7b35 --- /dev/null +++ b/BZOJ/1041/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3fca242dc7fea8344108ebf04ff1081ba78ecde09e294f610241e865c328668 +size 11 diff --git a/BZOJ/1041/data/1.out b/BZOJ/1041/data/1.out new file mode 100644 index 00000000..396b6814 --- /dev/null +++ b/BZOJ/1041/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1fb50e6c86fae1679ef3351296fd6713411a08cf8dd1790a4fd05fae8688164 +size 3 diff --git a/BZOJ/1041/data/10.in b/BZOJ/1041/data/10.in new file mode 100644 index 00000000..be9020b6 --- /dev/null +++ b/BZOJ/1041/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd3a23517489248c8270944826141f44d2c3763412f9e137b2d62a23c8890dd3 +size 5 diff --git a/BZOJ/1041/data/10.out b/BZOJ/1041/data/10.out new file mode 100644 index 00000000..0becde63 --- /dev/null +++ b/BZOJ/1041/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5378796307535df3ec8d8b15a2e2dc5641419c3d3060cfe32238c0fa973f7aa3 +size 3 diff --git a/BZOJ/1041/data/2.in b/BZOJ/1041/data/2.in new file mode 100644 index 00000000..56ef284e --- /dev/null +++ b/BZOJ/1041/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcc4420775aa33a37992d967d06c5b272e65225ad3ea5695b096ad3327528db0 +size 10 diff --git a/BZOJ/1041/data/2.out b/BZOJ/1041/data/2.out new file mode 100644 index 00000000..6089e6da --- /dev/null +++ b/BZOJ/1041/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce678067b339bdf19e0ed36e1f3a8c007439b2135a412cfda3ea1169e32dd1fc +size 4 diff --git a/BZOJ/1041/data/3.in b/BZOJ/1041/data/3.in new file mode 100644 index 00000000..3259cc6e --- /dev/null +++ b/BZOJ/1041/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93b45dce9410cd052448962a6ad46c5fbcceebd4b11d5574a17ea1b190d6f39e +size 11 diff --git a/BZOJ/1041/data/3.out b/BZOJ/1041/data/3.out new file mode 100644 index 00000000..6089e6da --- /dev/null +++ b/BZOJ/1041/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce678067b339bdf19e0ed36e1f3a8c007439b2135a412cfda3ea1169e32dd1fc +size 4 diff --git a/BZOJ/1041/data/4.in b/BZOJ/1041/data/4.in new file mode 100644 index 00000000..68a28b66 --- /dev/null +++ b/BZOJ/1041/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:720c5074d432ade477958facb3353c8de0c10ba42f5b592ef6c39e02d9fd3430 +size 10 diff --git a/BZOJ/1041/data/4.out b/BZOJ/1041/data/4.out new file mode 100644 index 00000000..d595cdb8 --- /dev/null +++ b/BZOJ/1041/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d +size 2 diff --git a/BZOJ/1041/data/5.in b/BZOJ/1041/data/5.in new file mode 100644 index 00000000..155d62ce --- /dev/null +++ b/BZOJ/1041/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54edd98f087538ac0974c76ec05a3490377914e98fdabcbec85158448e73e652 +size 11 diff --git a/BZOJ/1041/data/5.out b/BZOJ/1041/data/5.out new file mode 100644 index 00000000..396b6814 --- /dev/null +++ b/BZOJ/1041/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1fb50e6c86fae1679ef3351296fd6713411a08cf8dd1790a4fd05fae8688164 +size 3 diff --git a/BZOJ/1041/data/6.in b/BZOJ/1041/data/6.in new file mode 100644 index 00000000..ba747b52 --- /dev/null +++ b/BZOJ/1041/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f2264250160ee91b20af64f30128e3787fcf641f1c504f7ac752597e7d2cc09 +size 11 diff --git a/BZOJ/1041/data/6.out b/BZOJ/1041/data/6.out new file mode 100644 index 00000000..21b88a97 --- /dev/null +++ b/BZOJ/1041/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:461144ccfd56ee3cf0f9a9d80e520c5b872166b23092d5fd838ecbdb46d64dab +size 3 diff --git a/BZOJ/1041/data/7.in b/BZOJ/1041/data/7.in new file mode 100644 index 00000000..70774385 --- /dev/null +++ b/BZOJ/1041/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:730b93441bd57cffee53e3c133c0b647c3af6c52480a14a3a940336a25ea20f9 +size 11 diff --git a/BZOJ/1041/data/7.out b/BZOJ/1041/data/7.out new file mode 100644 index 00000000..d595cdb8 --- /dev/null +++ b/BZOJ/1041/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d +size 2 diff --git a/BZOJ/1041/data/8.in b/BZOJ/1041/data/8.in new file mode 100644 index 00000000..42202d57 --- /dev/null +++ b/BZOJ/1041/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:587fa438249a00cf5c0ff13e983ff862a6d652dd5e9fb2a8779e0edc734eab17 +size 10 diff --git a/BZOJ/1041/data/8.out b/BZOJ/1041/data/8.out new file mode 100644 index 00000000..396b6814 --- /dev/null +++ b/BZOJ/1041/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1fb50e6c86fae1679ef3351296fd6713411a08cf8dd1790a4fd05fae8688164 +size 3 diff --git a/BZOJ/1041/data/9.in b/BZOJ/1041/data/9.in new file mode 100644 index 00000000..848ec29c --- /dev/null +++ b/BZOJ/1041/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a21874aa5c707179b9ced62e1bb128584abb1bf0aa8ef8a18261398ff78bdcf +size 5 diff --git a/BZOJ/1041/data/9.out b/BZOJ/1041/data/9.out new file mode 100644 index 00000000..396b6814 --- /dev/null +++ b/BZOJ/1041/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1fb50e6c86fae1679ef3351296fd6713411a08cf8dd1790a4fd05fae8688164 +size 3