diff --git a/S2OJ/1320/1320.cpp b/S2OJ/1320/1320.cpp new file mode 100644 index 00000000..3e2bf40b --- /dev/null +++ b/S2OJ/1320/1320.cpp @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +std::string s, t; +std::vector> ans; + +bool check() { + if (std::count(s.begin(), s.end(), '1') != std::count(t.begin(), t.end(), '1')) { + return false; + } + + for (int i = 0; i < s.size(); i++) { + if (s[i] == t[i]) continue; + + int cnt = 0; + bool flag = false; + + for (int j = i; j < s.size(); j++) { + if (s[j] == '1') cnt++; + + if (s[j] == t[i] && cnt % 2 == 0) { + flag = true; + ans.emplace_back(i + 1, j + 1); + std::reverse(s.begin() + i, s.begin() + j + 1); + break; + } + } + + if (!flag) return false; + } + + return true; +} + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> s >> t; + + if (check()) { + cout << "YES" << endl + << ans.size() << endl; + + for (auto e : ans) { + cout << e.first << ' ' << e.second << endl; + } + } else { + cout << "NO" << endl; + } + + return 0; +} diff --git a/S2OJ/1320/data/chk.cpp b/S2OJ/1320/data/chk.cpp new file mode 100644 index 00000000..56245001 --- /dev/null +++ b/S2OJ/1320/data/chk.cpp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e30d1300c35e03f305a796df060dbe588071ad5577aea3f81b793f5395f499f +size 718 diff --git a/S2OJ/1320/data/ex_rev1.ans b/S2OJ/1320/data/ex_rev1.ans new file mode 100644 index 00000000..a7b940b0 --- /dev/null +++ b/S2OJ/1320/data/ex_rev1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf0f6cbbe68b1846acd7aa0d8dc9542d73037a9f4ef875fbee754fff3fedabeb +size 10 diff --git a/S2OJ/1320/data/ex_rev1.in b/S2OJ/1320/data/ex_rev1.in new file mode 100644 index 00000000..a07523c6 --- /dev/null +++ b/S2OJ/1320/data/ex_rev1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e40f82ff4735ba7686737d64adaaea60566f46c2566558440f3ec4e1615f1e3 +size 20 diff --git a/S2OJ/1320/data/ex_rev2.ans b/S2OJ/1320/data/ex_rev2.ans new file mode 100644 index 00000000..81d868ef --- /dev/null +++ b/S2OJ/1320/data/ex_rev2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfe72034a9f298fb79a6c1f2302673bb449c826d446b3efafdde95e6c48dc3ca +size 3 diff --git a/S2OJ/1320/data/ex_rev2.in b/S2OJ/1320/data/ex_rev2.in new file mode 100644 index 00000000..09bf4717 --- /dev/null +++ b/S2OJ/1320/data/ex_rev2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22328e228c89773fba4cdb41fd47bb91a744d47ca228a6fe2cbd8894123f672d +size 8 diff --git a/S2OJ/1320/data/problem.conf b/S2OJ/1320/data/problem.conf new file mode 100644 index 00000000..8fcacfee --- /dev/null +++ b/S2OJ/1320/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37634c9593f26861e173c83170508a3e90a2792a14068e6e6811d8009e0429c3 +size 187 diff --git a/S2OJ/1320/data/rev1.ans b/S2OJ/1320/data/rev1.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev1.in b/S2OJ/1320/data/rev1.in new file mode 100644 index 00000000..8357c3dd --- /dev/null +++ b/S2OJ/1320/data/rev1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4970407972abe6df69d82b63ef23d1c513275f09332309e168d61d6e05007dd +size 34 diff --git a/S2OJ/1320/data/rev10.ans b/S2OJ/1320/data/rev10.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev10.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev10.in b/S2OJ/1320/data/rev10.in new file mode 100644 index 00000000..089e9712 --- /dev/null +++ b/S2OJ/1320/data/rev10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e18564ba4d1835a7e4aae4143597852f3a8eb0fb10eb818526a1c6bf3a10ee1 +size 1362 diff --git a/S2OJ/1320/data/rev11.ans b/S2OJ/1320/data/rev11.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev11.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev11.in b/S2OJ/1320/data/rev11.in new file mode 100644 index 00000000..5606e6aa --- /dev/null +++ b/S2OJ/1320/data/rev11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e24b5e8910be74f4ecd97c3ca543d811432e09c7eb3cc8d0b2f47d4e930718e +size 1464 diff --git a/S2OJ/1320/data/rev12.ans b/S2OJ/1320/data/rev12.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev12.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev12.in b/S2OJ/1320/data/rev12.in new file mode 100644 index 00000000..480e9831 --- /dev/null +++ b/S2OJ/1320/data/rev12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c989935d3b9a3fdcf5446e1cc6e911b6ae7a23adef7b26a9023724d24448ef2b +size 1576 diff --git a/S2OJ/1320/data/rev13.ans b/S2OJ/1320/data/rev13.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev13.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev13.in b/S2OJ/1320/data/rev13.in new file mode 100644 index 00000000..c75c7ddb --- /dev/null +++ b/S2OJ/1320/data/rev13.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:378d6be2c9da8bdbf19b66d76f41221fdb5526502117c52b9298d11de646fd1f +size 18838 diff --git a/S2OJ/1320/data/rev14.ans b/S2OJ/1320/data/rev14.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev14.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev14.in b/S2OJ/1320/data/rev14.in new file mode 100644 index 00000000..cc81a3e7 --- /dev/null +++ b/S2OJ/1320/data/rev14.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfe98962b362c20baab7a7e28d39fc3489f603f4597b802de4caaf73bf90a502 +size 18262 diff --git a/S2OJ/1320/data/rev15.ans b/S2OJ/1320/data/rev15.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev15.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev15.in b/S2OJ/1320/data/rev15.in new file mode 100644 index 00000000..067d22db --- /dev/null +++ b/S2OJ/1320/data/rev15.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55edcaab28ca3375a5652fb8d9e75b0efc2b508d8590ee7e6e30b027ef234d13 +size 18286 diff --git a/S2OJ/1320/data/rev16.ans b/S2OJ/1320/data/rev16.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev16.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev16.in b/S2OJ/1320/data/rev16.in new file mode 100644 index 00000000..a92e8f38 --- /dev/null +++ b/S2OJ/1320/data/rev16.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92ac2e53a6cb915dd591ccbb76bd19364cf41564ca9640cbe30f98e4405a38e0 +size 19864 diff --git a/S2OJ/1320/data/rev17.ans b/S2OJ/1320/data/rev17.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev17.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev17.in b/S2OJ/1320/data/rev17.in new file mode 100644 index 00000000..74e0bc30 --- /dev/null +++ b/S2OJ/1320/data/rev17.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6fcc53067863257ad142cb376602485e47b7dcdb87744e9574c90aa6a068045 +size 18130 diff --git a/S2OJ/1320/data/rev18.ans b/S2OJ/1320/data/rev18.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev18.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev18.in b/S2OJ/1320/data/rev18.in new file mode 100644 index 00000000..e7d785d1 --- /dev/null +++ b/S2OJ/1320/data/rev18.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50697e7fa34af3edaab4598851132110cd500d9c9308993e7fde795bdac2129f +size 18190 diff --git a/S2OJ/1320/data/rev19.ans b/S2OJ/1320/data/rev19.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev19.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev19.in b/S2OJ/1320/data/rev19.in new file mode 100644 index 00000000..401d6d37 --- /dev/null +++ b/S2OJ/1320/data/rev19.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c12288a596489ec0838318dd6e528504e7bd1d78fb2da64efcc2d38f066528af +size 19466 diff --git a/S2OJ/1320/data/rev2.ans b/S2OJ/1320/data/rev2.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev2.in b/S2OJ/1320/data/rev2.in new file mode 100644 index 00000000..f2f9b0bb --- /dev/null +++ b/S2OJ/1320/data/rev2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9476da27d714fbbd77be1fb752b1b2fb8903619a61dd5b47e7ad20c9b072379 +size 34 diff --git a/S2OJ/1320/data/rev20.ans b/S2OJ/1320/data/rev20.ans new file mode 100644 index 00000000..81d868ef --- /dev/null +++ b/S2OJ/1320/data/rev20.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfe72034a9f298fb79a6c1f2302673bb449c826d446b3efafdde95e6c48dc3ca +size 3 diff --git a/S2OJ/1320/data/rev20.in b/S2OJ/1320/data/rev20.in new file mode 100644 index 00000000..073feea0 --- /dev/null +++ b/S2OJ/1320/data/rev20.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3f0e743808bd742806499cff06a94522030d0ee8a59d1ab4365cea9bf0ed4a8 +size 19690 diff --git a/S2OJ/1320/data/rev3.ans b/S2OJ/1320/data/rev3.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev3.in b/S2OJ/1320/data/rev3.in new file mode 100644 index 00000000..48dd1c8c --- /dev/null +++ b/S2OJ/1320/data/rev3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72a065b38ae9c3842adb6126b9bac0fa0ced9ec6d6629ec7c2bf191fd0a6c19b +size 30 diff --git a/S2OJ/1320/data/rev4.ans b/S2OJ/1320/data/rev4.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev4.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev4.in b/S2OJ/1320/data/rev4.in new file mode 100644 index 00000000..36333df6 --- /dev/null +++ b/S2OJ/1320/data/rev4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5de2281063666dc0f2aaf21b23c9463353d4c54835769baa1f088b9740dbc1a5 +size 34 diff --git a/S2OJ/1320/data/rev5.ans b/S2OJ/1320/data/rev5.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev5.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev5.in b/S2OJ/1320/data/rev5.in new file mode 100644 index 00000000..ef6cf7ae --- /dev/null +++ b/S2OJ/1320/data/rev5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbb0f91fe0b22cf751f6881d5b7c97c690ca470acb15e7bdb46232ae62a4395b +size 200 diff --git a/S2OJ/1320/data/rev6.ans b/S2OJ/1320/data/rev6.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev6.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev6.in b/S2OJ/1320/data/rev6.in new file mode 100644 index 00000000..755dce30 --- /dev/null +++ b/S2OJ/1320/data/rev6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:516678202fdd2a3bbd729626de4db89d434534449773682f7c0482f4eedb65d3 +size 188 diff --git a/S2OJ/1320/data/rev7.ans b/S2OJ/1320/data/rev7.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev7.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev7.in b/S2OJ/1320/data/rev7.in new file mode 100644 index 00000000..cef7a168 --- /dev/null +++ b/S2OJ/1320/data/rev7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:616f1f6a0d4375b0bd980e3143ba283de2595d0b25d057588600b2d6066fb62a +size 182 diff --git a/S2OJ/1320/data/rev8.ans b/S2OJ/1320/data/rev8.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev8.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev8.in b/S2OJ/1320/data/rev8.in new file mode 100644 index 00000000..d18f9c8c --- /dev/null +++ b/S2OJ/1320/data/rev8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb28fdab7262f07d9d03990e6a361223f00e09821ccffac3d20428f8702f6ab0 +size 200 diff --git a/S2OJ/1320/data/rev9.ans b/S2OJ/1320/data/rev9.ans new file mode 100644 index 00000000..fc234d78 --- /dev/null +++ b/S2OJ/1320/data/rev9.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a115e91c2e84c3078fa06914eff28d07590ddfaa47a55fb4f31dd7c5b3566194 +size 4 diff --git a/S2OJ/1320/data/rev9.in b/S2OJ/1320/data/rev9.in new file mode 100644 index 00000000..02c3a9f2 --- /dev/null +++ b/S2OJ/1320/data/rev9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d1053dca8dc18716aad5be73c40e5a96bbd8109a42323f5599a68b3ee6fc86a +size 1768