diff --git a/S2OJ/912/912.cpp b/S2OJ/912/912.cpp new file mode 100644 index 00000000..e151b590 --- /dev/null +++ b/S2OJ/912/912.cpp @@ -0,0 +1,45 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int N = 1e5 + 5; +const int mod = 998244353; + +int n, w[N], ans = 1; + +int binpow(int a, int b, int m) { + int res = 1; + + a %= m; + + while (b) { + if (b & 1) res = static_cast(res) * a % m; + a = static_cast(a) * a % m; + b >>= 1; + } + + return res; +} + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n; + + for (int i = 1; i <= n; i++) { + cin >> w[i]; + } + + for (int i = 2; i <= n; i++) { + ans = (static_cast(ans) + + static_cast(w[i]) * binpow(w[i] + w[1], mod - 2, mod) % mod) + % mod; + } + + cout << ans << endl; + + return 0; +} diff --git a/S2OJ/912/data/ex_hunter1.in b/S2OJ/912/data/ex_hunter1.in new file mode 100755 index 00000000..fb2daaa2 --- /dev/null +++ b/S2OJ/912/data/ex_hunter1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:680a60ed7efd7f07ca08913ed24f2b6ea1958ea1a5995c065c5cbb06bc2a212f +size 8 diff --git a/S2OJ/912/data/ex_hunter1.out b/S2OJ/912/data/ex_hunter1.out new file mode 100755 index 00000000..88975262 --- /dev/null +++ b/S2OJ/912/data/ex_hunter1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:417ccff1f69294e528f04a8fdc911450557c38bcfbf9bcb926e381d77637d859 +size 10 diff --git a/S2OJ/912/data/hunter1.in b/S2OJ/912/data/hunter1.in new file mode 100755 index 00000000..bf12ffb9 --- /dev/null +++ b/S2OJ/912/data/hunter1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15d74ac8747b851bcb3232ae16a0b041a79a0d74efb9ab396e2ccf2d754eae5b +size 41 diff --git a/S2OJ/912/data/hunter1.out b/S2OJ/912/data/hunter1.out new file mode 100755 index 00000000..805fb4ef --- /dev/null +++ b/S2OJ/912/data/hunter1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:814bac02b6e7d82267ab689d05be7be7835b6a7e665e28ceef723f32ba471c98 +size 10 diff --git a/S2OJ/912/data/hunter10.in b/S2OJ/912/data/hunter10.in new file mode 100755 index 00000000..2ff31aca --- /dev/null +++ b/S2OJ/912/data/hunter10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ca891ef246dabbeb6d219c10b4deccd20c623bcdfa13140b02b34d74bb2c41c +size 856552 diff --git a/S2OJ/912/data/hunter10.out b/S2OJ/912/data/hunter10.out new file mode 100755 index 00000000..ce88b720 --- /dev/null +++ b/S2OJ/912/data/hunter10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ff94697f0b01da48e492911ec6eb411be3f0e35b2163434107af54d335af4a5 +size 10 diff --git a/S2OJ/912/data/hunter11.in b/S2OJ/912/data/hunter11.in new file mode 100755 index 00000000..4cd2f9d9 --- /dev/null +++ b/S2OJ/912/data/hunter11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35881b85950993fc36b0172233bfc96c12125292ea7a33de0927242312617bd6 +size 752905 diff --git a/S2OJ/912/data/hunter11.out b/S2OJ/912/data/hunter11.out new file mode 100755 index 00000000..df44f2e6 --- /dev/null +++ b/S2OJ/912/data/hunter11.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc85e81f0e08d316482a57ce2b3388c0893a1f9f74d54ebee0db48a40eecab10 +size 10 diff --git a/S2OJ/912/data/hunter12.in b/S2OJ/912/data/hunter12.in new file mode 100755 index 00000000..1b704912 --- /dev/null +++ b/S2OJ/912/data/hunter12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dc8cb31d8229c66ed14727b8bfbd3541ec2575d0bb4448fda855665fc7f9d43 +size 832105 diff --git a/S2OJ/912/data/hunter12.out b/S2OJ/912/data/hunter12.out new file mode 100755 index 00000000..43b80f5a --- /dev/null +++ b/S2OJ/912/data/hunter12.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d20c353c51073ddd749218c1706b5d7d209b9105251e39a728f57fa9c626fd7e +size 10 diff --git a/S2OJ/912/data/hunter13.in b/S2OJ/912/data/hunter13.in new file mode 100755 index 00000000..ed9b0418 --- /dev/null +++ b/S2OJ/912/data/hunter13.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df73d35b0bedb22c7dd84eb068035a8bffb5ddbe06adc18b58425db54d6daa6d +size 940368 diff --git a/S2OJ/912/data/hunter13.out b/S2OJ/912/data/hunter13.out new file mode 100755 index 00000000..2abb67a7 --- /dev/null +++ b/S2OJ/912/data/hunter13.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0657c18d1b638fc7f923f7511c2dc572eb7d0738c04e05ab07b5cd487db1f4a4 +size 10 diff --git a/S2OJ/912/data/hunter14.in b/S2OJ/912/data/hunter14.in new file mode 100755 index 00000000..173bc04a --- /dev/null +++ b/S2OJ/912/data/hunter14.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:868b7e49bd4986177334592159d25eddd5d806b935be31f66071fa0bb32f988b +size 973911 diff --git a/S2OJ/912/data/hunter14.out b/S2OJ/912/data/hunter14.out new file mode 100755 index 00000000..aab33929 --- /dev/null +++ b/S2OJ/912/data/hunter14.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f02434cd9c73541d24fca81047dc1a58cc0c6474e1c7f12e675da10bce768ea +size 10 diff --git a/S2OJ/912/data/hunter15.in b/S2OJ/912/data/hunter15.in new file mode 100755 index 00000000..b69278a8 --- /dev/null +++ b/S2OJ/912/data/hunter15.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f20158f398e13b4562d5c53b60eca4a96c2857cf248e41670bc71ac54500a2dc +size 815740 diff --git a/S2OJ/912/data/hunter15.out b/S2OJ/912/data/hunter15.out new file mode 100755 index 00000000..9818d993 --- /dev/null +++ b/S2OJ/912/data/hunter15.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30c853fc7b0c527fd35152f600ee159f9ccf13d1100154a29496b18e1608e1fd +size 10 diff --git a/S2OJ/912/data/hunter16.in b/S2OJ/912/data/hunter16.in new file mode 100755 index 00000000..4744eb38 --- /dev/null +++ b/S2OJ/912/data/hunter16.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe5625ff7a066fdd866d6deee62ff08b256923b42607de47f325af77cc517e34 +size 942578 diff --git a/S2OJ/912/data/hunter16.out b/S2OJ/912/data/hunter16.out new file mode 100755 index 00000000..b8826eaf --- /dev/null +++ b/S2OJ/912/data/hunter16.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bede356a3e41c8b422efa860691a6a8f0b465d107bcbd8bfccf2efd6d8e140d +size 10 diff --git a/S2OJ/912/data/hunter17.in b/S2OJ/912/data/hunter17.in new file mode 100755 index 00000000..84be7a57 --- /dev/null +++ b/S2OJ/912/data/hunter17.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ea3730f49e23701afc6e1cd5099fe9d56341e6aa0ceee1d87497101709d358e +size 757911 diff --git a/S2OJ/912/data/hunter17.out b/S2OJ/912/data/hunter17.out new file mode 100755 index 00000000..180b824f --- /dev/null +++ b/S2OJ/912/data/hunter17.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:054597195bcb9597d761b7873d45ef8e5bcddd6ab2e9efc96b7a350f37554f03 +size 10 diff --git a/S2OJ/912/data/hunter18.in b/S2OJ/912/data/hunter18.in new file mode 100755 index 00000000..016da32d --- /dev/null +++ b/S2OJ/912/data/hunter18.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65c808ba07f4b0f5685118ef2009d5574abadfb8947eb2e19a951c3d63b53f53 +size 912411 diff --git a/S2OJ/912/data/hunter18.out b/S2OJ/912/data/hunter18.out new file mode 100755 index 00000000..c4591923 --- /dev/null +++ b/S2OJ/912/data/hunter18.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e70644e1d0abdab633bfb9abc99bde0cea7983853de38935599948eeb1c9879b +size 10 diff --git a/S2OJ/912/data/hunter19.in b/S2OJ/912/data/hunter19.in new file mode 100755 index 00000000..20ae8473 --- /dev/null +++ b/S2OJ/912/data/hunter19.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a45f126d164ea9f8755ff3306cec42ff44214272220f93d54a2fdd1bf0f693ee +size 897525 diff --git a/S2OJ/912/data/hunter19.out b/S2OJ/912/data/hunter19.out new file mode 100755 index 00000000..e59224fd --- /dev/null +++ b/S2OJ/912/data/hunter19.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ec8c1815f9029ec7396fe4a4d3f43444bd29d6b842abc3a8d69044a294ebb85 +size 10 diff --git a/S2OJ/912/data/hunter2.in b/S2OJ/912/data/hunter2.in new file mode 100755 index 00000000..0cdbdd4a --- /dev/null +++ b/S2OJ/912/data/hunter2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2fcf691021b1352b474d8990b78395373f996851f371c05c78ca26d2607220d +size 91 diff --git a/S2OJ/912/data/hunter2.out b/S2OJ/912/data/hunter2.out new file mode 100755 index 00000000..2b5c20df --- /dev/null +++ b/S2OJ/912/data/hunter2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4efdad3e13ad37200d49624c82e51da6ce108c44a7a2c99a970065f1031f1912 +size 10 diff --git a/S2OJ/912/data/hunter20.in b/S2OJ/912/data/hunter20.in new file mode 100755 index 00000000..b42c0014 --- /dev/null +++ b/S2OJ/912/data/hunter20.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1152cf95023e15eeac43ff615e5adf6d5f5bf148fdd413c50831ee75429a4eda +size 42 diff --git a/S2OJ/912/data/hunter20.out b/S2OJ/912/data/hunter20.out new file mode 100755 index 00000000..55b32354 --- /dev/null +++ b/S2OJ/912/data/hunter20.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4443fe78b5090ae6ecda45c4668e843258ba0710509059c93f31bf8ed4af535 +size 10 diff --git a/S2OJ/912/data/hunter3.in b/S2OJ/912/data/hunter3.in new file mode 100755 index 00000000..01b56560 --- /dev/null +++ b/S2OJ/912/data/hunter3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11a4ac599c3d6e985fdc6aab03239bf132910c7f4756c0696b63b49a72be521c +size 103 diff --git a/S2OJ/912/data/hunter3.out b/S2OJ/912/data/hunter3.out new file mode 100755 index 00000000..67da16f4 --- /dev/null +++ b/S2OJ/912/data/hunter3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50fa8534647d5e256d3855eb1f590ae56597fb8019dca7bea939ae79b0aab639 +size 9 diff --git a/S2OJ/912/data/hunter4.in b/S2OJ/912/data/hunter4.in new file mode 100755 index 00000000..c6661268 --- /dev/null +++ b/S2OJ/912/data/hunter4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b71380d3c9ec02454bd5c88c1c198cf21056421c0d1f395457e8ba3d2092cbf +size 42 diff --git a/S2OJ/912/data/hunter4.out b/S2OJ/912/data/hunter4.out new file mode 100755 index 00000000..265fbd66 --- /dev/null +++ b/S2OJ/912/data/hunter4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bc31631b0499bdc2a93f3929da3379073222ff691d149f24402b382f1cc803e +size 10 diff --git a/S2OJ/912/data/hunter5.in b/S2OJ/912/data/hunter5.in new file mode 100755 index 00000000..685eed3c --- /dev/null +++ b/S2OJ/912/data/hunter5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3321be47f0a2fc47ca11f8d9af7330e7b5390985294a36f8cbe88ed8d4451c5a +size 197 diff --git a/S2OJ/912/data/hunter5.out b/S2OJ/912/data/hunter5.out new file mode 100755 index 00000000..1e403b48 --- /dev/null +++ b/S2OJ/912/data/hunter5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ad9b3981fed92beed64d8570bc31a50a03e565119d1cd79834d9f6ba4a5bc2 +size 9 diff --git a/S2OJ/912/data/hunter6.in b/S2OJ/912/data/hunter6.in new file mode 100755 index 00000000..43991ee1 --- /dev/null +++ b/S2OJ/912/data/hunter6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8514113c2f70bef75c5ef9819b901b95a8eba025942ff2a4a2c5aa8de754e641 +size 200 diff --git a/S2OJ/912/data/hunter6.out b/S2OJ/912/data/hunter6.out new file mode 100755 index 00000000..aa3fcbaa --- /dev/null +++ b/S2OJ/912/data/hunter6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:995f2ce44cc511b81deac06b1120bab32624b77cce809882377411344c174f6f +size 10 diff --git a/S2OJ/912/data/hunter7.in b/S2OJ/912/data/hunter7.in new file mode 100755 index 00000000..6222baf8 --- /dev/null +++ b/S2OJ/912/data/hunter7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e38b728b2e05d887613a5c85c07ff8d88f7c86030b1138356ece4203ead646f8 +size 169 diff --git a/S2OJ/912/data/hunter7.out b/S2OJ/912/data/hunter7.out new file mode 100755 index 00000000..a676b88b --- /dev/null +++ b/S2OJ/912/data/hunter7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4b6a731fc9617bd17a2d5d412935c30e40ccda0e1057e45b8a3089c6bbb8efd +size 10 diff --git a/S2OJ/912/data/hunter8.in b/S2OJ/912/data/hunter8.in new file mode 100755 index 00000000..175981fb --- /dev/null +++ b/S2OJ/912/data/hunter8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ba041a2724b2f3d1af6e8e37a1725c32abf62513667d758bcf1e13cae0cbe64 +size 199 diff --git a/S2OJ/912/data/hunter8.out b/S2OJ/912/data/hunter8.out new file mode 100755 index 00000000..448a9dc6 --- /dev/null +++ b/S2OJ/912/data/hunter8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16f4aad98fc66d1dd3ac9bdbaf51419b4346440b3ceba616658eed2b14a0eae0 +size 10 diff --git a/S2OJ/912/data/hunter9.in b/S2OJ/912/data/hunter9.in new file mode 100755 index 00000000..818faca9 --- /dev/null +++ b/S2OJ/912/data/hunter9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65a1e5c2785cc9eb9f807975779f0bb6319aedf73f1688b85fed44b8f61524fe +size 932742 diff --git a/S2OJ/912/data/hunter9.out b/S2OJ/912/data/hunter9.out new file mode 100755 index 00000000..938fbf46 --- /dev/null +++ b/S2OJ/912/data/hunter9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01197fa6bf193e1c55259a6bf1767dfe6f572c590fc8e3ef4e682419dee5a6b3 +size 10 diff --git a/S2OJ/912/data/problem.conf b/S2OJ/912/data/problem.conf new file mode 100755 index 00000000..2334e2c6 --- /dev/null +++ b/S2OJ/912/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:117e53b3d3da62eaba9f64e92399db4a91008ed2a5287c003b32cc68d63fd200 +size 181