diff --git a/LibreOJ/3737/3737.cpp b/LibreOJ/3737/3737.cpp new file mode 100644 index 00000000..0c0d6584 --- /dev/null +++ b/LibreOJ/3737/3737.cpp @@ -0,0 +1,65 @@ +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int mod = 1e9 + 7; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + int n; + long long ans = 1; + + cin >> n; + + std::vector> data(n); + + for (auto &item : data) { + cin >> item.first; + } + + for (auto &item : data) { + cin >> item.second; + } + + for (auto &item : data) { + if (item.first == 1) { + ans = (ans + item.second) % mod; + item.first = -1; + } + } + + long double max = ans; + auto max_it = data.end(); + + for (auto it = data.begin(); it != data.end(); it++) { + if (it->first == -1) continue; + + long double t = static_cast(ans + it->second) / it->first; + + if (t > max) { + max = t; + max_it = it; + } + } + + if (max_it != data.end()) { + ans += max_it->second; + max_it->first = -1; + } + + for (const auto &item : data) { + if (~item.first) { + ans = (ans * item.first) % mod; + } + } + + cout << ans << endl; + + return 0; +} diff --git a/LibreOJ/3737/data/food1.ans b/LibreOJ/3737/data/food1.ans new file mode 100644 index 00000000..6b197e4d --- /dev/null +++ b/LibreOJ/3737/data/food1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ae4a2ec2c88db5da735f1b66458b93f7d25559d003588003b481c35825138c1 +size 10 diff --git a/LibreOJ/3737/data/food1.in b/LibreOJ/3737/data/food1.in new file mode 100644 index 00000000..a90346ce --- /dev/null +++ b/LibreOJ/3737/data/food1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d459e56b4b63780e97bcb88c93a9385772bbab181998490b9435d36c3271e62 +size 90 diff --git a/LibreOJ/3737/data/food10.ans b/LibreOJ/3737/data/food10.ans new file mode 100644 index 00000000..c18f5968 --- /dev/null +++ b/LibreOJ/3737/data/food10.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:670cea33125d654090a883822d9385fa9ed1d81e52dd3cac7d628ebcc5bebf49 +size 10 diff --git a/LibreOJ/3737/data/food10.in b/LibreOJ/3737/data/food10.in new file mode 100644 index 00000000..d2496773 --- /dev/null +++ b/LibreOJ/3737/data/food10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49a89af5f4cdb4ca90de5b27c3c6d853642942ae226cfa1354f8989947d6c368 +size 21237 diff --git a/LibreOJ/3737/data/food11.ans b/LibreOJ/3737/data/food11.ans new file mode 100644 index 00000000..e9051360 --- /dev/null +++ b/LibreOJ/3737/data/food11.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb54b3283eaf6b9e9cb9b105436a6a1a48b62ccdce2c8375f276c79fbfc9a250 +size 9 diff --git a/LibreOJ/3737/data/food11.in b/LibreOJ/3737/data/food11.in new file mode 100644 index 00000000..ec642baa --- /dev/null +++ b/LibreOJ/3737/data/food11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc5846458cd13274173f75fc7dfc4ecc2d151ffdefdcebbdc6906045ab346e85 +size 17816 diff --git a/LibreOJ/3737/data/food12.ans b/LibreOJ/3737/data/food12.ans new file mode 100644 index 00000000..32aee8c6 --- /dev/null +++ b/LibreOJ/3737/data/food12.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c6c6d4c68f6cedb3ff821a253b2774d8a122033c51a74bf693c7d9f3cb1c9bb +size 10 diff --git a/LibreOJ/3737/data/food12.in b/LibreOJ/3737/data/food12.in new file mode 100644 index 00000000..07dc537c --- /dev/null +++ b/LibreOJ/3737/data/food12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeafa30d82dc304f2e9ba6bc025e209242b8d73a1bda456301052eb1ba6ddad3 +size 25076 diff --git a/LibreOJ/3737/data/food13.ans b/LibreOJ/3737/data/food13.ans new file mode 100644 index 00000000..8d148377 --- /dev/null +++ b/LibreOJ/3737/data/food13.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0d6f055ffadf084d8c81c54884b8098f60f7b5be46291a604a67b3511340f05 +size 10 diff --git a/LibreOJ/3737/data/food13.in b/LibreOJ/3737/data/food13.in new file mode 100644 index 00000000..dc8f5d3b --- /dev/null +++ b/LibreOJ/3737/data/food13.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e30e5e8babdafd31ad6ccf28292e8e197207923cdca50936a0e915e781d2df58 +size 6849760 diff --git a/LibreOJ/3737/data/food14.ans b/LibreOJ/3737/data/food14.ans new file mode 100644 index 00000000..f6c0e4c2 --- /dev/null +++ b/LibreOJ/3737/data/food14.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de7e67a5c9d7db499f55eebe9a688c57fb45ae4a1b3e864b01c37e812921125c +size 10 diff --git a/LibreOJ/3737/data/food14.in b/LibreOJ/3737/data/food14.in new file mode 100644 index 00000000..423610f5 --- /dev/null +++ b/LibreOJ/3737/data/food14.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c726ad51a126f20614f3a70ec9b03385a863fb7651d61c91aceba2ae2e2f5ce +size 5144056 diff --git a/LibreOJ/3737/data/food15.ans b/LibreOJ/3737/data/food15.ans new file mode 100644 index 00000000..c79d2fdf --- /dev/null +++ b/LibreOJ/3737/data/food15.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66a5f310f8ec3b0866fb7346b1496e39d83ec89e157ba2d9b35282a11a5faa86 +size 10 diff --git a/LibreOJ/3737/data/food15.in b/LibreOJ/3737/data/food15.in new file mode 100644 index 00000000..e3d41e95 --- /dev/null +++ b/LibreOJ/3737/data/food15.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e06d5c31741c72bfb12dbdddedbc12cb44ff80b0cf9024743c95b6f41335a873 +size 6888413 diff --git a/LibreOJ/3737/data/food16.ans b/LibreOJ/3737/data/food16.ans new file mode 100644 index 00000000..df370332 --- /dev/null +++ b/LibreOJ/3737/data/food16.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cc7a1151835e8a7c0c6e5d1cd44bc39dfddbf362a73aabf8b8b66fb0acd0edc +size 10 diff --git a/LibreOJ/3737/data/food16.in b/LibreOJ/3737/data/food16.in new file mode 100644 index 00000000..5da0bf51 --- /dev/null +++ b/LibreOJ/3737/data/food16.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:963a812ad93a20919bfb6c73bd994c077fbb4cbf8ff388db35cddddcf213dc6c +size 6889004 diff --git a/LibreOJ/3737/data/food17.ans b/LibreOJ/3737/data/food17.ans new file mode 100644 index 00000000..c1a8e653 --- /dev/null +++ b/LibreOJ/3737/data/food17.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b44f0cdad933b7f49cc3b3f82fc115d61d32493fe346ebf0fe4887f17a3633a +size 10 diff --git a/LibreOJ/3737/data/food17.in b/LibreOJ/3737/data/food17.in new file mode 100644 index 00000000..66c39900 --- /dev/null +++ b/LibreOJ/3737/data/food17.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad334d36181492780f4d1b3ce86ef10431a0b2ced19545b73483f14ff2f70676 +size 1046458 diff --git a/LibreOJ/3737/data/food18.ans b/LibreOJ/3737/data/food18.ans new file mode 100644 index 00000000..0492ff17 --- /dev/null +++ b/LibreOJ/3737/data/food18.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12eb5ce466ea92ebcb4bbab086c1900229a8388a5eb85e3ac42c50281e9db579 +size 10 diff --git a/LibreOJ/3737/data/food18.in b/LibreOJ/3737/data/food18.in new file mode 100644 index 00000000..a1d9e640 --- /dev/null +++ b/LibreOJ/3737/data/food18.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6029de6b3fa3c27fd862a5e589f36ac2dfa714664bd2c1e8663808a6bf1b3267 +size 1035667 diff --git a/LibreOJ/3737/data/food19.ans b/LibreOJ/3737/data/food19.ans new file mode 100644 index 00000000..7d5f6827 --- /dev/null +++ b/LibreOJ/3737/data/food19.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4bdbcba0e6f68e1a55c7dac3a7a6fd094366b0a5a613c1f27221f9dc6b7eca6 +size 10 diff --git a/LibreOJ/3737/data/food19.in b/LibreOJ/3737/data/food19.in new file mode 100644 index 00000000..778bd983 --- /dev/null +++ b/LibreOJ/3737/data/food19.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93a322c0dcaae81781481333e4c9cb5ee7bb40d66737435a9dd17aeabdc477e9 +size 4905595 diff --git a/LibreOJ/3737/data/food2.ans b/LibreOJ/3737/data/food2.ans new file mode 100644 index 00000000..98fe868a --- /dev/null +++ b/LibreOJ/3737/data/food2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5a155c7050bca9799696dd1021477569d4a5745f42e84cfd18a001e70f07556 +size 10 diff --git a/LibreOJ/3737/data/food2.in b/LibreOJ/3737/data/food2.in new file mode 100644 index 00000000..fe3f2381 --- /dev/null +++ b/LibreOJ/3737/data/food2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3fe63e49b5edf768d8b2553f248793ded83e0e6d39708bd9bd5fa28b4e22c73 +size 93 diff --git a/LibreOJ/3737/data/food20.ans b/LibreOJ/3737/data/food20.ans new file mode 100644 index 00000000..434cba28 --- /dev/null +++ b/LibreOJ/3737/data/food20.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1495654e1a816930a786956577297665fa61a07c73117f2662893dbcb4274da +size 10 diff --git a/LibreOJ/3737/data/food20.in b/LibreOJ/3737/data/food20.in new file mode 100644 index 00000000..b8fe5b8c --- /dev/null +++ b/LibreOJ/3737/data/food20.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a20b6e06fa3d6c98cc4160563707a4f4c44cb87be1ffff5ca29fd738fd9748da +size 5261743 diff --git a/LibreOJ/3737/data/food3.ans b/LibreOJ/3737/data/food3.ans new file mode 100644 index 00000000..fac602a0 --- /dev/null +++ b/LibreOJ/3737/data/food3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eef988b2262a47fb27700e18858f6cab29afd9424fdd0fd4248c6041af6a7b51 +size 8 diff --git a/LibreOJ/3737/data/food3.in b/LibreOJ/3737/data/food3.in new file mode 100644 index 00000000..21477446 --- /dev/null +++ b/LibreOJ/3737/data/food3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfcaf338c8d466df197d23facf9de2285e78d6c5d0ad2f43c8326c015f370f6f +size 93 diff --git a/LibreOJ/3737/data/food4.ans b/LibreOJ/3737/data/food4.ans new file mode 100644 index 00000000..0e253991 --- /dev/null +++ b/LibreOJ/3737/data/food4.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83363771eb69adefd3caeb8deb3480ed0febd79a87ed0207babf50fd56f54e81 +size 10 diff --git a/LibreOJ/3737/data/food4.in b/LibreOJ/3737/data/food4.in new file mode 100644 index 00000000..da9508da --- /dev/null +++ b/LibreOJ/3737/data/food4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae69e0a88070c0ae493c14398cc78929c0f41abbac38b287acaba100f32afb73 +size 93 diff --git a/LibreOJ/3737/data/food5.ans b/LibreOJ/3737/data/food5.ans new file mode 100644 index 00000000..22a04cf4 --- /dev/null +++ b/LibreOJ/3737/data/food5.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:312c13147d5cfb0d22e36199eafe432e511b831f4ac4e624c16303dfccc06d0e +size 10 diff --git a/LibreOJ/3737/data/food5.in b/LibreOJ/3737/data/food5.in new file mode 100644 index 00000000..104154ff --- /dev/null +++ b/LibreOJ/3737/data/food5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b16f3a52f23b6c57bf37541a4d4123bee0f560a2dff45b4f75c6ce8ff4c84199 +size 163 diff --git a/LibreOJ/3737/data/food6.ans b/LibreOJ/3737/data/food6.ans new file mode 100644 index 00000000..7f35c82a --- /dev/null +++ b/LibreOJ/3737/data/food6.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c065ae649438a8158464ad0337c33d2d0d88e2d1cf5c00e1ea48e55e0ff0e1c +size 10 diff --git a/LibreOJ/3737/data/food6.in b/LibreOJ/3737/data/food6.in new file mode 100644 index 00000000..5c80cabe --- /dev/null +++ b/LibreOJ/3737/data/food6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae1388a8771fc360380240900e4c5c807e403698e2e43e73369d6e2739b788d +size 177 diff --git a/LibreOJ/3737/data/food7.ans b/LibreOJ/3737/data/food7.ans new file mode 100644 index 00000000..c357fa6e --- /dev/null +++ b/LibreOJ/3737/data/food7.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dad795a0962236c1997c1f6c9bb5dfc12a123e833b0a58343184423e23a81057 +size 10 diff --git a/LibreOJ/3737/data/food7.in b/LibreOJ/3737/data/food7.in new file mode 100644 index 00000000..4a30d735 --- /dev/null +++ b/LibreOJ/3737/data/food7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fce1d4721aa813c73bc34e1c03587e44dc92236472a184ab6ef0e3aaeb655f3 +size 180 diff --git a/LibreOJ/3737/data/food8.ans b/LibreOJ/3737/data/food8.ans new file mode 100644 index 00000000..14948724 --- /dev/null +++ b/LibreOJ/3737/data/food8.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:398119b424bbb2527038534b7ddb4c71aeea7fd58cd03947a0354e0d730a3a80 +size 10 diff --git a/LibreOJ/3737/data/food8.in b/LibreOJ/3737/data/food8.in new file mode 100644 index 00000000..ce710065 --- /dev/null +++ b/LibreOJ/3737/data/food8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edef789e2058e14187e9274d4d2753a3470b5a65b3c625e98fb0c304238e4a09 +size 153 diff --git a/LibreOJ/3737/data/food9.ans b/LibreOJ/3737/data/food9.ans new file mode 100644 index 00000000..ce4c8a4e --- /dev/null +++ b/LibreOJ/3737/data/food9.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44da0c3953b9a1f6543731e64a251abde8d3bb07b17a6ebb31081192859fd0c4 +size 10 diff --git a/LibreOJ/3737/data/food9.in b/LibreOJ/3737/data/food9.in new file mode 100644 index 00000000..8300a3b0 --- /dev/null +++ b/LibreOJ/3737/data/food9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31580f03de69e380299f2f2e1f1a0191c971fe9120501d1047bbf59fbc99ee56 +size 28016