From 63eace5d982fc79493f9fac38a0c17ad746771af Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 10 Oct 2022 15:37:54 +0800 Subject: [PATCH] =?UTF-8?q?#1625.=20=E3=80=902022.10.10=20=E8=81=94?= =?UTF-8?q?=E8=80=83=E3=80=91=E9=87=91=E6=9E=AA=E9=B1=BC=EF=BC=88ggf?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sjzezoj.com/submission/59954 --- S2OJ/1625/1625.cpp | 98 +++++++++++++++++++++++++++++++++++++ S2OJ/1625/data/ex_ggf1.ans | 3 ++ S2OJ/1625/data/ex_ggf1.in | 3 ++ S2OJ/1625/data/ex_ggf2.ans | 3 ++ S2OJ/1625/data/ex_ggf2.in | 3 ++ S2OJ/1625/data/ex_ggf3.ans | 3 ++ S2OJ/1625/data/ex_ggf3.in | 3 ++ S2OJ/1625/data/ggf1.ans | 3 ++ S2OJ/1625/data/ggf1.in | 3 ++ S2OJ/1625/data/ggf10.ans | 3 ++ S2OJ/1625/data/ggf10.in | 3 ++ S2OJ/1625/data/ggf2.ans | 3 ++ S2OJ/1625/data/ggf2.in | 3 ++ S2OJ/1625/data/ggf3.ans | 3 ++ S2OJ/1625/data/ggf3.in | 3 ++ S2OJ/1625/data/ggf4.ans | 3 ++ S2OJ/1625/data/ggf4.in | 3 ++ S2OJ/1625/data/ggf5.ans | 3 ++ S2OJ/1625/data/ggf5.in | 3 ++ S2OJ/1625/data/ggf6.ans | 3 ++ S2OJ/1625/data/ggf6.in | 3 ++ S2OJ/1625/data/ggf7.ans | 3 ++ S2OJ/1625/data/ggf7.in | 3 ++ S2OJ/1625/data/ggf8.ans | 3 ++ S2OJ/1625/data/ggf8.in | 3 ++ S2OJ/1625/data/ggf9.ans | 3 ++ S2OJ/1625/data/ggf9.in | 3 ++ S2OJ/1625/data/problem.conf | 3 ++ 28 files changed, 179 insertions(+) create mode 100644 S2OJ/1625/1625.cpp create mode 100644 S2OJ/1625/data/ex_ggf1.ans create mode 100644 S2OJ/1625/data/ex_ggf1.in create mode 100644 S2OJ/1625/data/ex_ggf2.ans create mode 100644 S2OJ/1625/data/ex_ggf2.in create mode 100644 S2OJ/1625/data/ex_ggf3.ans create mode 100644 S2OJ/1625/data/ex_ggf3.in create mode 100644 S2OJ/1625/data/ggf1.ans create mode 100644 S2OJ/1625/data/ggf1.in create mode 100644 S2OJ/1625/data/ggf10.ans create mode 100644 S2OJ/1625/data/ggf10.in create mode 100644 S2OJ/1625/data/ggf2.ans create mode 100644 S2OJ/1625/data/ggf2.in create mode 100644 S2OJ/1625/data/ggf3.ans create mode 100644 S2OJ/1625/data/ggf3.in create mode 100644 S2OJ/1625/data/ggf4.ans create mode 100644 S2OJ/1625/data/ggf4.in create mode 100644 S2OJ/1625/data/ggf5.ans create mode 100644 S2OJ/1625/data/ggf5.in create mode 100644 S2OJ/1625/data/ggf6.ans create mode 100644 S2OJ/1625/data/ggf6.in create mode 100644 S2OJ/1625/data/ggf7.ans create mode 100644 S2OJ/1625/data/ggf7.in create mode 100644 S2OJ/1625/data/ggf8.ans create mode 100644 S2OJ/1625/data/ggf8.in create mode 100644 S2OJ/1625/data/ggf9.ans create mode 100644 S2OJ/1625/data/ggf9.in create mode 100644 S2OJ/1625/data/problem.conf diff --git a/S2OJ/1625/1625.cpp b/S2OJ/1625/1625.cpp new file mode 100644 index 00000000..aa7ccb0e --- /dev/null +++ b/S2OJ/1625/1625.cpp @@ -0,0 +1,98 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +std::string s, t; +int cnt[10]; + +void add(int x, int f = 1) { + switch (x) { + case 4: + cnt[3] += f; + cnt[2] += 2 * f; + + break; + + case 6: + cnt[5] += f; + cnt[3] += f; + + break; + + case 8: + cnt[7] += f; + cnt[2] += 3 * f; + + break; + + case 9: + cnt[7] += f; + cnt[3] += 2 * f; + cnt[2] += f; + + break; + + default: + cnt[x] += f; + + break; + } +} + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> s; + + for (char c : s) { + add(c - '0'); + } + + while (cnt[7] >= 1 && cnt[3] >= 2 && cnt[2] >= 1) { + add(9, -1); + + t.push_back('9'); + } + + while (cnt[7] >= 1 && cnt[2] >= 3) { + add(8, -1); + t.push_back('8'); + } + + while (cnt[7]) { + add(7, -1); + t.push_back('7'); + } + + while (cnt[5] && cnt[3]) { + add(6, -1); + t.push_back('6'); + } + + while (cnt[5]) { + add(5, -1); + t.push_back('5'); + } + + while (cnt[3] >= 1 && cnt[2] >= 2) { + add(4, -1); + t.push_back('4'); + } + + while (cnt[3]) { + add(3, -1); + t.push_back('3'); + } + + while (cnt[2]) { + add(2, -1); + t.push_back('2'); + } + + cout << (t.empty() ? "?????" : t) << endl; + + return 0; +} diff --git a/S2OJ/1625/data/ex_ggf1.ans b/S2OJ/1625/data/ex_ggf1.ans new file mode 100644 index 00000000..88953db3 --- /dev/null +++ b/S2OJ/1625/data/ex_ggf1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e55092af0746630c98d1b2e0d960617c33f8ea7b55739fd18cb7cd5342a28ca +size 3 diff --git a/S2OJ/1625/data/ex_ggf1.in b/S2OJ/1625/data/ex_ggf1.in new file mode 100644 index 00000000..b9bf4f2d --- /dev/null +++ b/S2OJ/1625/data/ex_ggf1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b57026b863c9e8dbc7524e91dc90a935653e6d812218d030a7e7f6c58a20a541 +size 5 diff --git a/S2OJ/1625/data/ex_ggf2.ans b/S2OJ/1625/data/ex_ggf2.ans new file mode 100644 index 00000000..222e174e --- /dev/null +++ b/S2OJ/1625/data/ex_ggf2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:997fe4e88e759ca92721d1e9e1fccc69e3a6752284d1588d53b9fb817c2d1c25 +size 11 diff --git a/S2OJ/1625/data/ex_ggf2.in b/S2OJ/1625/data/ex_ggf2.in new file mode 100644 index 00000000..846de4b9 --- /dev/null +++ b/S2OJ/1625/data/ex_ggf2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:576127127ab9b66c789988b7351c071b7628a1178db6d6f1b06d6065539a066d +size 13 diff --git a/S2OJ/1625/data/ex_ggf3.ans b/S2OJ/1625/data/ex_ggf3.ans new file mode 100644 index 00000000..72adf528 --- /dev/null +++ b/S2OJ/1625/data/ex_ggf3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c68fc752c64ccaa3b354ff5a527c3bbb1e050150d62faf28dedb86c4727c1fb +size 798469 diff --git a/S2OJ/1625/data/ex_ggf3.in b/S2OJ/1625/data/ex_ggf3.in new file mode 100644 index 00000000..e4f33a11 --- /dev/null +++ b/S2OJ/1625/data/ex_ggf3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcdff74ab8d5c6b2d91a3e796fb6643c2eceace80b6ca5418ea9c87a1c0269f7 +size 1000001 diff --git a/S2OJ/1625/data/ggf1.ans b/S2OJ/1625/data/ggf1.ans new file mode 100644 index 00000000..2abef1e5 --- /dev/null +++ b/S2OJ/1625/data/ggf1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff9dc2442ccd3eaf78e9ae007e29f9c7717786c262f1303ae31c187dc0f3b85d +size 6 diff --git a/S2OJ/1625/data/ggf1.in b/S2OJ/1625/data/ggf1.in new file mode 100644 index 00000000..2a129e5b --- /dev/null +++ b/S2OJ/1625/data/ggf1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:136712be50948e2e85058a97c177220c977adbe01130b9426c713247b5f7d22d +size 6 diff --git a/S2OJ/1625/data/ggf10.ans b/S2OJ/1625/data/ggf10.ans new file mode 100644 index 00000000..e931ce87 --- /dev/null +++ b/S2OJ/1625/data/ggf10.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9083622f1944d1b712598a37589903cb05288c9b4d4e4dba03b3424c0c9e5cb1 +size 801915 diff --git a/S2OJ/1625/data/ggf10.in b/S2OJ/1625/data/ggf10.in new file mode 100644 index 00000000..6a2e248a --- /dev/null +++ b/S2OJ/1625/data/ggf10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c611fc429e5fa00ca3f0461810086f79bfccde1d955316c5f693f2de245aa9d0 +size 1000001 diff --git a/S2OJ/1625/data/ggf2.ans b/S2OJ/1625/data/ggf2.ans new file mode 100644 index 00000000..61d91096 --- /dev/null +++ b/S2OJ/1625/data/ggf2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd5060041d1fba3a55c7ba6a885536403cbb6476dbb1e52f4818ff85dd87fef4 +size 7 diff --git a/S2OJ/1625/data/ggf2.in b/S2OJ/1625/data/ggf2.in new file mode 100644 index 00000000..09164e72 --- /dev/null +++ b/S2OJ/1625/data/ggf2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58a3776a853138fcb7ef5f136d1212b003a8c6a9065d1509cfcbd3f1c49480b4 +size 6 diff --git a/S2OJ/1625/data/ggf3.ans b/S2OJ/1625/data/ggf3.ans new file mode 100644 index 00000000..187f4dee --- /dev/null +++ b/S2OJ/1625/data/ggf3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2159c00db79e11023298b62db4a2952eb8c85c276a9a120ab351e411d1665a35 +size 4 diff --git a/S2OJ/1625/data/ggf3.in b/S2OJ/1625/data/ggf3.in new file mode 100644 index 00000000..3b16b40d --- /dev/null +++ b/S2OJ/1625/data/ggf3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2be11924501f7c33bc89412d2107ca695224d07751c8fdf2cd95d4dfe9985a46 +size 6 diff --git a/S2OJ/1625/data/ggf4.ans b/S2OJ/1625/data/ggf4.ans new file mode 100644 index 00000000..aa38b3c8 --- /dev/null +++ b/S2OJ/1625/data/ggf4.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db19ca20c4a47f5cfe770664ce9f7b6ef683cfeea4ddc2e11cf8ac953f9594c5 +size 8 diff --git a/S2OJ/1625/data/ggf4.in b/S2OJ/1625/data/ggf4.in new file mode 100644 index 00000000..03e04e35 --- /dev/null +++ b/S2OJ/1625/data/ggf4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:caf293140d1b5f5cb0eac41f68d900b0cfc8379a316ba4b8d8ecd017449533e6 +size 6 diff --git a/S2OJ/1625/data/ggf5.ans b/S2OJ/1625/data/ggf5.ans new file mode 100644 index 00000000..021d0891 --- /dev/null +++ b/S2OJ/1625/data/ggf5.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:763984f55066cb2ca8c0c13a3060cc9652251673dbcab9345d1a6d6b6e085722 +size 79983 diff --git a/S2OJ/1625/data/ggf5.in b/S2OJ/1625/data/ggf5.in new file mode 100644 index 00000000..0570727d --- /dev/null +++ b/S2OJ/1625/data/ggf5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd0413acb12f6b63b8f9c4cb8e8b7e4ef13ad675df1c37c9fe2ae32162a39278 +size 100001 diff --git a/S2OJ/1625/data/ggf6.ans b/S2OJ/1625/data/ggf6.ans new file mode 100644 index 00000000..2ca6cff1 --- /dev/null +++ b/S2OJ/1625/data/ggf6.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00b48700a72d32474c8a6305dec14118baebaedaaea73fecfc487defcde9ea0a +size 79673 diff --git a/S2OJ/1625/data/ggf6.in b/S2OJ/1625/data/ggf6.in new file mode 100644 index 00000000..cd37df49 --- /dev/null +++ b/S2OJ/1625/data/ggf6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fe6ae4f2a448c8336d9e0f1d9a8f7ff6bc3055bca6e74521a6cc645ac7bf9a8 +size 100001 diff --git a/S2OJ/1625/data/ggf7.ans b/S2OJ/1625/data/ggf7.ans new file mode 100644 index 00000000..224821a9 --- /dev/null +++ b/S2OJ/1625/data/ggf7.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75bb7ea10dd2e810a0c59fd160385fbb3bdd05069c7d9c99949801bf8f57cb28 +size 79993 diff --git a/S2OJ/1625/data/ggf7.in b/S2OJ/1625/data/ggf7.in new file mode 100644 index 00000000..730aa224 --- /dev/null +++ b/S2OJ/1625/data/ggf7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68747ce36759a384ae2185fbea99f209c1a12bdcf0926aa59cc7566021c193a2 +size 100001 diff --git a/S2OJ/1625/data/ggf8.ans b/S2OJ/1625/data/ggf8.ans new file mode 100644 index 00000000..16e9b9db --- /dev/null +++ b/S2OJ/1625/data/ggf8.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1631b89ca6b701533011a8c84e53cb633b70eccbcc8faa831d65ba43fc27cb4 +size 80270 diff --git a/S2OJ/1625/data/ggf8.in b/S2OJ/1625/data/ggf8.in new file mode 100644 index 00000000..cd4e9164 --- /dev/null +++ b/S2OJ/1625/data/ggf8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35754750f598e30fef6a6e35bfb82114b4bd83a8285200ee083ed9e759dee9b4 +size 100001 diff --git a/S2OJ/1625/data/ggf9.ans b/S2OJ/1625/data/ggf9.ans new file mode 100644 index 00000000..61be4b1d --- /dev/null +++ b/S2OJ/1625/data/ggf9.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94f6e7cb3c42b7db9e0991e4eb881916a73b79e55ecd5481df7fe5a8c3bdaa1e +size 799304 diff --git a/S2OJ/1625/data/ggf9.in b/S2OJ/1625/data/ggf9.in new file mode 100644 index 00000000..720aa801 --- /dev/null +++ b/S2OJ/1625/data/ggf9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0856143cd0b733d92a912c1a640a83ac843832b8282b56d042e6b8c2bbe53a3f +size 1000001 diff --git a/S2OJ/1625/data/problem.conf b/S2OJ/1625/data/problem.conf new file mode 100644 index 00000000..736f5d09 --- /dev/null +++ b/S2OJ/1625/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd569993bcdf780d4ac839a4093f0416e95bd0394a07814faea73a55b62ba181 +size 175