diff --git a/S2OJ/1664/1664.cpp b/S2OJ/1664/1664.cpp new file mode 100644 index 00000000..7ef8687d --- /dev/null +++ b/S2OJ/1664/1664.cpp @@ -0,0 +1,42 @@ +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int N = 1e5 + 5; + +int n, m, c[N]; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n >> m; + + while (n--) { + int l, r; + + cin >> l >> r; + + l--; + + for (int i = 1, j = 0; i <= r; i = j + 1) { + if (l / i == 0) j = r; + else j = std::min(l / (l / i), r / (r / i)); + + if (r / i - l / i > 0) { + c[i]++, c[j + 1]--; + } + } + } + + std::partial_sum(c + 1, c + 1 + m, c + 1); + + for (int i = 1; i <= m; i++) { + cout << c[i] << endl; + } + + return 0; +} diff --git a/S2OJ/1664/data/ex_souvenir1.in b/S2OJ/1664/data/ex_souvenir1.in new file mode 100644 index 00000000..f669dc32 --- /dev/null +++ b/S2OJ/1664/data/ex_souvenir1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f51ed31e9d7fac03d21024c578a6a0085902f3e843f624f31f6f6a0b8e7f859e +size 16 diff --git a/S2OJ/1664/data/ex_souvenir1.out b/S2OJ/1664/data/ex_souvenir1.out new file mode 100644 index 00000000..41edd091 --- /dev/null +++ b/S2OJ/1664/data/ex_souvenir1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c98f5e8f9ccc98857c763243e8553e05af3c44ea109425b76dd8c0e1bc01429a +size 6 diff --git a/S2OJ/1664/data/ex_souvenir2.in b/S2OJ/1664/data/ex_souvenir2.in new file mode 100644 index 00000000..65f0a61b --- /dev/null +++ b/S2OJ/1664/data/ex_souvenir2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04225e04887fc95f3011be38c3dda5882b784cbe6ef543006438a37909b35a55 +size 32 diff --git a/S2OJ/1664/data/ex_souvenir2.out b/S2OJ/1664/data/ex_souvenir2.out new file mode 100644 index 00000000..85ee7a6f --- /dev/null +++ b/S2OJ/1664/data/ex_souvenir2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ce792c02415e5c242c3b7bf177ce4a71b2c74b4c3d2fd364b21c3d8b38dca38 +size 18 diff --git a/S2OJ/1664/data/problem.conf b/S2OJ/1664/data/problem.conf new file mode 100644 index 00000000..230a6ca7 --- /dev/null +++ b/S2OJ/1664/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf10bef8123b7dbe605f85af53b1cfe2907cdce2bdc7c9f62469268b95861653 +size 185 diff --git a/S2OJ/1664/data/souvenir1.in b/S2OJ/1664/data/souvenir1.in new file mode 100644 index 00000000..1cb3efc1 --- /dev/null +++ b/S2OJ/1664/data/souvenir1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd43d67c0e33965b6471d9052e67b14bf3f12dd6885dad1a1beca03dd6a1c81 +size 1748 diff --git a/S2OJ/1664/data/souvenir1.out b/S2OJ/1664/data/souvenir1.out new file mode 100644 index 00000000..e9cf783f --- /dev/null +++ b/S2OJ/1664/data/souvenir1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08db93fd17e5ffc224d8deb1ff99d60d5ec6c37c2f745fbffe9c4cc7ceb06595 +size 786 diff --git a/S2OJ/1664/data/souvenir10.in b/S2OJ/1664/data/souvenir10.in new file mode 100644 index 00000000..48b56d2e --- /dev/null +++ b/S2OJ/1664/data/souvenir10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd5f933ad8f8e117a51e6b6e9093ba14f12d919d0810ae624e2b18c794faa4e5 +size 2524194 diff --git a/S2OJ/1664/data/souvenir10.out b/S2OJ/1664/data/souvenir10.out new file mode 100644 index 00000000..1476da20 --- /dev/null +++ b/S2OJ/1664/data/souvenir10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c6afaeb4643a4033bab481d8b0c7f6d6bd4f688c494764df9f4d8f5746df406 +size 699956 diff --git a/S2OJ/1664/data/souvenir2.in b/S2OJ/1664/data/souvenir2.in new file mode 100644 index 00000000..69b5fe5e --- /dev/null +++ b/S2OJ/1664/data/souvenir2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98e4e5c1bae940b8f2b581bf3dd27957a9eb467344d9a15e1243cc250c8e48d1 +size 2226 diff --git a/S2OJ/1664/data/souvenir2.out b/S2OJ/1664/data/souvenir2.out new file mode 100644 index 00000000..d4afa917 --- /dev/null +++ b/S2OJ/1664/data/souvenir2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fe06046a87bb3269e104eaa9a881d26a6b67068cfb9d025e51fee82578a4161 +size 1758 diff --git a/S2OJ/1664/data/souvenir3.in b/S2OJ/1664/data/souvenir3.in new file mode 100644 index 00000000..8114997c --- /dev/null +++ b/S2OJ/1664/data/souvenir3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:225fa062a78ba2c1b0fbf039ffcb9ee719fdd717f71a84147bb72ecc7ed9934a +size 2266721 diff --git a/S2OJ/1664/data/souvenir3.out b/S2OJ/1664/data/souvenir3.out new file mode 100644 index 00000000..2412a57d --- /dev/null +++ b/S2OJ/1664/data/souvenir3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:964924fac71066178259ef3712a1be41bd929f2bc2eec8d3e217bae546b06b00 +size 24685 diff --git a/S2OJ/1664/data/souvenir4.in b/S2OJ/1664/data/souvenir4.in new file mode 100644 index 00000000..28958b4f --- /dev/null +++ b/S2OJ/1664/data/souvenir4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:810d1293fa04dbd6a584b9c2c04eb18dcaac035cbf34b2c33d63677bb6dcb6d9 +size 2335814 diff --git a/S2OJ/1664/data/souvenir4.out b/S2OJ/1664/data/souvenir4.out new file mode 100644 index 00000000..b6b447f6 --- /dev/null +++ b/S2OJ/1664/data/souvenir4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2b76004517986e643cf021b6b01ee4fa8d0796cc51f213f09ea98b49c374724 +size 6774 diff --git a/S2OJ/1664/data/souvenir5.in b/S2OJ/1664/data/souvenir5.in new file mode 100644 index 00000000..2ce8970e --- /dev/null +++ b/S2OJ/1664/data/souvenir5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5bcc17aea8b88f6521f2e4598141e5890e72e044b915ba293aa5e93fdd274c7 +size 47751 diff --git a/S2OJ/1664/data/souvenir5.out b/S2OJ/1664/data/souvenir5.out new file mode 100644 index 00000000..65c07810 --- /dev/null +++ b/S2OJ/1664/data/souvenir5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4120fee209c6e654687eceb962cb606c8ea635cea849d0e1589046b8792fa567 +size 24401 diff --git a/S2OJ/1664/data/souvenir6.in b/S2OJ/1664/data/souvenir6.in new file mode 100644 index 00000000..dab2cd0b --- /dev/null +++ b/S2OJ/1664/data/souvenir6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59aa9ce93f7d9b6efce6fdb980ca38e8544cdf1d8ae2b1e2cb1c32b57f0f84b4 +size 47766 diff --git a/S2OJ/1664/data/souvenir6.out b/S2OJ/1664/data/souvenir6.out new file mode 100644 index 00000000..b28f0ba4 --- /dev/null +++ b/S2OJ/1664/data/souvenir6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f71ea706b50db522970785e7c43b166064d65d5875ad74f44dc3ec55b5cd536 +size 24364 diff --git a/S2OJ/1664/data/souvenir7.in b/S2OJ/1664/data/souvenir7.in new file mode 100644 index 00000000..834bc559 --- /dev/null +++ b/S2OJ/1664/data/souvenir7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b88d904762c119129c470f7b69d551123c3b9c4ecbcd4fcb6f99f6ce71bad545 +size 2570792 diff --git a/S2OJ/1664/data/souvenir7.out b/S2OJ/1664/data/souvenir7.out new file mode 100644 index 00000000..f0653681 --- /dev/null +++ b/S2OJ/1664/data/souvenir7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f7333a266d864e18edb1a73f288ca288a768d26eff284b6a72f1eac9b4ea96a +size 422628 diff --git a/S2OJ/1664/data/souvenir8.in b/S2OJ/1664/data/souvenir8.in new file mode 100644 index 00000000..4ac2f452 --- /dev/null +++ b/S2OJ/1664/data/souvenir8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82a1953edbc2099b0ce09c70c0c7b5e2a652818703340856bab84fceef4d6e52 +size 2750562 diff --git a/S2OJ/1664/data/souvenir8.out b/S2OJ/1664/data/souvenir8.out new file mode 100644 index 00000000..fdc25f60 --- /dev/null +++ b/S2OJ/1664/data/souvenir8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:629f02d10690376d8ba744cc3ff6423e35d972592ff51d544ba9249db8f8e37a +size 388531 diff --git a/S2OJ/1664/data/souvenir9.in b/S2OJ/1664/data/souvenir9.in new file mode 100644 index 00000000..10667a24 --- /dev/null +++ b/S2OJ/1664/data/souvenir9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b46e3882ae3739969988ba7e7fa3f30908a929753bde05f56ebef50937061a35 +size 2523868 diff --git a/S2OJ/1664/data/souvenir9.out b/S2OJ/1664/data/souvenir9.out new file mode 100644 index 00000000..2cd010b3 --- /dev/null +++ b/S2OJ/1664/data/souvenir9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b87b16df84c0a0482fc12b1f62689da97aa4bcd21f159cbdfe05048fda32156 +size 699956