diff --git a/BZOJ/3062/3062.cpp b/BZOJ/3062/3062.cpp new file mode 100644 index 00000000..4072290e --- /dev/null +++ b/BZOJ/3062/3062.cpp @@ -0,0 +1,38 @@ +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int N = 1e5 + 5; + +int n, m, x[N], y[N]; +long long ans; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n >> m; + + x[0] = m; + + for (int i = 1; i <= n; i++) { + cin >> x[i] >> y[i]; + + ans += std::abs(x[i] - y[i]); + } + + std::sort(x, x + 1 + n); + std::sort(y, y + 1 + n); + + for (int i = 0; i <= n; i++) { + ans += std::abs(x[i] - y[i]); + } + + cout << ans << endl; + + return 0; +} diff --git a/BZOJ/3062/data/1.in b/BZOJ/3062/data/1.in new file mode 100644 index 00000000..27cc58e1 --- /dev/null +++ b/BZOJ/3062/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbc7f346120c831cc27f85d2447189ceee2bc8b3ef7ff0b92fe425bbdd754244 +size 49 diff --git a/BZOJ/3062/data/1.out b/BZOJ/3062/data/1.out new file mode 100644 index 00000000..dee03707 --- /dev/null +++ b/BZOJ/3062/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64459cd36006fa4bb2f5314f2a1ad69c8cbbb95f319c5459b32a9cdc870b54aa +size 3 diff --git a/BZOJ/3062/data/10.in b/BZOJ/3062/data/10.in new file mode 100644 index 00000000..bd30cb2a --- /dev/null +++ b/BZOJ/3062/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8df5a3058868da31ed445cfe78c3ea59ab4b3fe9bd4d2348a79c8c3cbc26fe50 +size 19754 diff --git a/BZOJ/3062/data/10.out b/BZOJ/3062/data/10.out new file mode 100644 index 00000000..74f050d7 --- /dev/null +++ b/BZOJ/3062/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:827678ae87ae060fe3b7cedaa75b8d114db4d4c0b392c5a5cec6aa522915d15e +size 13 diff --git a/BZOJ/3062/data/11.in b/BZOJ/3062/data/11.in new file mode 100644 index 00000000..17c6a020 --- /dev/null +++ b/BZOJ/3062/data/11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2f3f6dae69005ae9c56c4a01f6b6cd7bc294b081ea1cf31e3967f1b504e06ee +size 197440 diff --git a/BZOJ/3062/data/11.out b/BZOJ/3062/data/11.out new file mode 100644 index 00000000..fcd3b29b --- /dev/null +++ b/BZOJ/3062/data/11.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c7a62fa3cb2defd690008cf058eddce4a8cad3087e4098190621000e17625ae +size 14 diff --git a/BZOJ/3062/data/12.in b/BZOJ/3062/data/12.in new file mode 100644 index 00000000..e3596bce --- /dev/null +++ b/BZOJ/3062/data/12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e04d6cd7c3334358b4b994f3232467b1b6e823bf8316c83ae5c3d194613e258 +size 13 diff --git a/BZOJ/3062/data/12.out b/BZOJ/3062/data/12.out new file mode 100644 index 00000000..396b6814 --- /dev/null +++ b/BZOJ/3062/data/12.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1fb50e6c86fae1679ef3351296fd6713411a08cf8dd1790a4fd05fae8688164 +size 3 diff --git a/BZOJ/3062/data/2.in b/BZOJ/3062/data/2.in new file mode 100644 index 00000000..bd07edb3 --- /dev/null +++ b/BZOJ/3062/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:281c5cb510af76d1e884591d812bd90747d541fcf724a6b0b247d1635d1fc23b +size 206 diff --git a/BZOJ/3062/data/2.out b/BZOJ/3062/data/2.out new file mode 100644 index 00000000..4ca62439 --- /dev/null +++ b/BZOJ/3062/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6dd3d588cbf13bf972a515da6045fb2beed61fdca7de6b6658debf5c041a0248 +size 6 diff --git a/BZOJ/3062/data/3.in b/BZOJ/3062/data/3.in new file mode 100644 index 00000000..505e30bb --- /dev/null +++ b/BZOJ/3062/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53463a153f849e09eb20446df07520baa36f5575beae36c8038fc2d3b7117095 +size 1580 diff --git a/BZOJ/3062/data/3.out b/BZOJ/3062/data/3.out new file mode 100644 index 00000000..3e4e24c4 --- /dev/null +++ b/BZOJ/3062/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6e8b7768a148109dfe200d74cb645ef00dbfa9080de10ff1ef0e591261dacb5 +size 10 diff --git a/BZOJ/3062/data/4.in b/BZOJ/3062/data/4.in new file mode 100644 index 00000000..4ebcba33 --- /dev/null +++ b/BZOJ/3062/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad835f6ebe980b56ce75995afe902a777864aec8f7afb03b98870dad89f2b7ea +size 1973885 diff --git a/BZOJ/3062/data/4.out b/BZOJ/3062/data/4.out new file mode 100644 index 00000000..a54dee38 --- /dev/null +++ b/BZOJ/3062/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:448afc89c59ffc6c54f1ec7c65c61605603e3e50f0c1b95a3d3d7425da122984 +size 15 diff --git a/BZOJ/3062/data/5.in b/BZOJ/3062/data/5.in new file mode 100644 index 00000000..c9d75dd2 --- /dev/null +++ b/BZOJ/3062/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d35822f85a104e5388baef8d93b032d9f35815db1ec5e297cafd378836f0bfbc +size 987403 diff --git a/BZOJ/3062/data/5.out b/BZOJ/3062/data/5.out new file mode 100644 index 00000000..06991186 --- /dev/null +++ b/BZOJ/3062/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b47499e48f905359b88d63473d6a86bda129a20333a767484c949cc21bed73e3 +size 15 diff --git a/BZOJ/3062/data/6.in b/BZOJ/3062/data/6.in new file mode 100644 index 00000000..2ef8424e --- /dev/null +++ b/BZOJ/3062/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2fba6d0cdaa0a13353f5da0787ec3415ea656bb4c30a19256f2c7225a77ea76 +size 1977877 diff --git a/BZOJ/3062/data/6.out b/BZOJ/3062/data/6.out new file mode 100644 index 00000000..c8121e8a --- /dev/null +++ b/BZOJ/3062/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542bd5d026c35cf855be5a7c3bf384d3d25de266e2f090d0ddab520367657ee3 +size 15 diff --git a/BZOJ/3062/data/7.in b/BZOJ/3062/data/7.in new file mode 100644 index 00000000..358bbf7e --- /dev/null +++ b/BZOJ/3062/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57dedaa46286d4eb70c697c5aceddaaa03d13c5983db4a481ec7ba0ce083d99f +size 211 diff --git a/BZOJ/3062/data/7.out b/BZOJ/3062/data/7.out new file mode 100644 index 00000000..12e77e41 --- /dev/null +++ b/BZOJ/3062/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb8c0ea1aabca742cbf0c8b27ce1b877776c3ae05917c5176a2b9061f5280856 +size 11 diff --git a/BZOJ/3062/data/8.in b/BZOJ/3062/data/8.in new file mode 100644 index 00000000..a75ea676 --- /dev/null +++ b/BZOJ/3062/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34f8dff17ed8ecff64684bd8521ebb5048fd7d1c2874a3d5f5bc9eb7c1931873 +size 778305 diff --git a/BZOJ/3062/data/8.out b/BZOJ/3062/data/8.out new file mode 100644 index 00000000..090bf4c2 --- /dev/null +++ b/BZOJ/3062/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa055ea2e3bd22bd9f9ffc111cce0f136b1b32247e29049440902f54be9b40dc +size 9 diff --git a/BZOJ/3062/data/9.in b/BZOJ/3062/data/9.in new file mode 100644 index 00000000..55c072e4 --- /dev/null +++ b/BZOJ/3062/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d080ac527bae4ce74d6db846148b65648fb704e7773caa279a2554ae196c68f +size 1977334 diff --git a/BZOJ/3062/data/9.out b/BZOJ/3062/data/9.out new file mode 100644 index 00000000..71b7b25d --- /dev/null +++ b/BZOJ/3062/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecaeeb83526a9850a364c888d93f0fa5d382e48b4d42fcc61966f2e10e5cf9ec +size 15