diff --git a/BZOJ/1702/1702.cpp b/BZOJ/1702/1702.cpp new file mode 100644 index 00000000..8760bf12 --- /dev/null +++ b/BZOJ/1702/1702.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n, m, ans; +std::map, int> map; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n >> m; + + std::vector s(m); + + map[s] = 0; + for (int i = 1, x; i <= n; i++) { + cin >> x; + + for (int j = 0; j < m; j++) { + if (x >> j & 1) s[j]++; + } + + if (!std::count(s.begin(), s.end(), 0)) { + for (int& x : s) x--; + } + + if (map.count(s)) { + ans = std::max(ans, i - map[s]); + } else { + map[s] = i; + } + } + + cout << ans << endl; + + return 0; +} diff --git a/BZOJ/1702/data/1.in b/BZOJ/1702/data/1.in new file mode 100644 index 00000000..310ea470 --- /dev/null +++ b/BZOJ/1702/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5187ca71f23612293a6f598c8f8f320eca9ce7597aefdfef1219b339e7f65ee1 +size 18 diff --git a/BZOJ/1702/data/1.out b/BZOJ/1702/data/1.out new file mode 100644 index 00000000..d595cdb8 --- /dev/null +++ b/BZOJ/1702/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d +size 2 diff --git a/BZOJ/1702/data/10.in b/BZOJ/1702/data/10.in new file mode 100644 index 00000000..474fc71a --- /dev/null +++ b/BZOJ/1702/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41a0bf4cc711483db4ac0fffb0dfdd44f2d42a53b6d8fe80cc38b9e197ebdd87 +size 6 diff --git a/BZOJ/1702/data/10.out b/BZOJ/1702/data/10.out new file mode 100644 index 00000000..1afab5f7 --- /dev/null +++ b/BZOJ/1702/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 +size 2 diff --git a/BZOJ/1702/data/11.in b/BZOJ/1702/data/11.in new file mode 100644 index 00000000..33a26023 --- /dev/null +++ b/BZOJ/1702/data/11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4469a620218aa6296fdcd68dfa792993fc185369994f259adc3fd808ff855ee +size 995735 diff --git a/BZOJ/1702/data/11.out b/BZOJ/1702/data/11.out new file mode 100644 index 00000000..0adf22f4 --- /dev/null +++ b/BZOJ/1702/data/11.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdea77b0a0e30106dffbc9d265ea60971ac8aaa3ae22cba9b4807657f2934ee2 +size 6 diff --git a/BZOJ/1702/data/12.in b/BZOJ/1702/data/12.in new file mode 100644 index 00000000..24225992 --- /dev/null +++ b/BZOJ/1702/data/12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76d336ce2d24e1067e5c473dd72fc28c3116c02fdf21696079109708130b1c2a +size 2667 diff --git a/BZOJ/1702/data/12.out b/BZOJ/1702/data/12.out new file mode 100644 index 00000000..fe854cc0 --- /dev/null +++ b/BZOJ/1702/data/12.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aab3b681a0fc417d64b7a7d716ad36d631bc576f114a4f63a7e436963b6d0cbc +size 4 diff --git a/BZOJ/1702/data/2.in b/BZOJ/1702/data/2.in new file mode 100644 index 00000000..62dc5006 --- /dev/null +++ b/BZOJ/1702/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c07a90fb046c882b19fafa941eda82564f768df44bb3391b48732a64fd2506b +size 18 diff --git a/BZOJ/1702/data/2.out b/BZOJ/1702/data/2.out new file mode 100644 index 00000000..f2baf931 --- /dev/null +++ b/BZOJ/1702/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10159baf262b43a92d95db59dae1f72c645127301661e0a3ce4e38b295a97c58 +size 2 diff --git a/BZOJ/1702/data/3.in b/BZOJ/1702/data/3.in new file mode 100644 index 00000000..60c6ef60 --- /dev/null +++ b/BZOJ/1702/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8161168429f8f754708127e920c0423999222009df121f1cd1be6782fc076d7 +size 506 diff --git a/BZOJ/1702/data/3.out b/BZOJ/1702/data/3.out new file mode 100644 index 00000000..b8a27df8 --- /dev/null +++ b/BZOJ/1702/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c78a99d2279a1f64709a9adee6bff80120f18bdd0ae7bdc220443d5750f36a92 +size 4 diff --git a/BZOJ/1702/data/4.in b/BZOJ/1702/data/4.in new file mode 100644 index 00000000..59127d0d --- /dev/null +++ b/BZOJ/1702/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b6a56f9cb28f13852ab2a031d6bab96afd9ba08ee9de825736ecd751e260cbe +size 518701 diff --git a/BZOJ/1702/data/4.out b/BZOJ/1702/data/4.out new file mode 100644 index 00000000..97db0f1f --- /dev/null +++ b/BZOJ/1702/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:792376c209f338959be4cf00c54dbf82662b90516082e23106faec4c43c69e49 +size 4 diff --git a/BZOJ/1702/data/5.in b/BZOJ/1702/data/5.in new file mode 100644 index 00000000..4ad75495 --- /dev/null +++ b/BZOJ/1702/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c96d6c4f7619a1cbc5646172dd07b0143e28ae6f6ee9f78facd6a7ae37e7be3d +size 35 diff --git a/BZOJ/1702/data/5.out b/BZOJ/1702/data/5.out new file mode 100644 index 00000000..06d04c2c --- /dev/null +++ b/BZOJ/1702/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa67a169b0bba217aa0aa88a65346920c84c42447c36ba5f7ea65f422c1fe5d8 +size 2 diff --git a/BZOJ/1702/data/6.in b/BZOJ/1702/data/6.in new file mode 100644 index 00000000..f63fa007 --- /dev/null +++ b/BZOJ/1702/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00c7a9c6047a55dd0d8ae1e8c34e816549fa0f5a275f23662517c86bb543a2f1 +size 812057 diff --git a/BZOJ/1702/data/6.out b/BZOJ/1702/data/6.out new file mode 100644 index 00000000..fee53f67 --- /dev/null +++ b/BZOJ/1702/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5372588733824ecf5744e694f5d12b57d33e19ff1fd8b88a7e723e7426eea890 +size 6 diff --git a/BZOJ/1702/data/7.in b/BZOJ/1702/data/7.in new file mode 100644 index 00000000..bf4b20f4 --- /dev/null +++ b/BZOJ/1702/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bca4285c30fc57f599cc887d6db63eb3337f7656ad418e74a3058038e0473b76 +size 172690 diff --git a/BZOJ/1702/data/7.out b/BZOJ/1702/data/7.out new file mode 100644 index 00000000..fee53f67 --- /dev/null +++ b/BZOJ/1702/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5372588733824ecf5744e694f5d12b57d33e19ff1fd8b88a7e723e7426eea890 +size 6 diff --git a/BZOJ/1702/data/8.in b/BZOJ/1702/data/8.in new file mode 100644 index 00000000..bba792fd --- /dev/null +++ b/BZOJ/1702/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0556e99fc77930fe2efab1decddd4c400fb0afcf868b6daeec98276b1638abdf +size 65 diff --git a/BZOJ/1702/data/8.out b/BZOJ/1702/data/8.out new file mode 100644 index 00000000..804fcc90 --- /dev/null +++ b/BZOJ/1702/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa +size 2 diff --git a/BZOJ/1702/data/9.in b/BZOJ/1702/data/9.in new file mode 100644 index 00000000..076e2118 --- /dev/null +++ b/BZOJ/1702/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d73572d475cc6c15e5e5909dace54bee7a63b281b4c6e47f1ec454fa237b3e3 +size 11255 diff --git a/BZOJ/1702/data/9.out b/BZOJ/1702/data/9.out new file mode 100644 index 00000000..f76b2924 --- /dev/null +++ b/BZOJ/1702/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d1eb4d5a102bb441143c544509f03ba95ff5890e3d2433091380f9aeac9d27 +size 5