├── .gitattributes ├── .gitignore ├── part1 ├── A │ ├── data │ │ ├── problem.conf │ │ ├── std.cpp │ │ ├── test1.in │ │ ├── test1.out │ │ ├── test10.in │ │ ├── test10.out │ │ ├── test2.in │ │ ├── test2.out │ │ ├── test3.in │ │ ├── test3.out │ │ ├── test4.in │ │ ├── test4.out │ │ ├── test5.in │ │ ├── test5.out │ │ ├── test6.in │ │ ├── test6.out │ │ ├── test7.in │ │ ├── test7.out │ │ ├── test8.in │ │ ├── test8.out │ │ ├── test9.in │ │ ├── test9.out │ │ └── val.cpp │ └── statement.md ├── B │ ├── data │ │ ├── problem.conf │ │ ├── std.cpp │ │ ├── test1.in │ │ ├── test1.out │ │ ├── test10.in │ │ ├── test10.out │ │ ├── test11.in │ │ ├── test11.out │ │ ├── test12.in │ │ ├── test12.out │ │ ├── test13.in │ │ ├── test13.out │ │ ├── test14.in │ │ ├── test14.out │ │ ├── test15.in │ │ ├── test15.out │ │ ├── test16.in │ │ ├── test16.out │ │ ├── test17.in │ │ ├── test17.out │ │ ├── test18.in │ │ ├── test18.out │ │ ├── test19.in │ │ ├── test19.out │ │ ├── test2.in │ │ ├── test2.out │ │ ├── test20.in │ │ ├── test20.out │ │ ├── test21.in │ │ ├── test21.out │ │ ├── test22.in │ │ ├── test22.out │ │ ├── test23.in │ │ ├── test23.out │ │ ├── test24.in │ │ ├── test24.out │ │ ├── test25.in │ │ ├── test25.out │ │ ├── test26.in │ │ ├── test26.out │ │ ├── test27.in │ │ ├── test27.out │ │ ├── test28.in │ │ ├── test28.out │ │ ├── test29.in │ │ ├── test29.out │ │ ├── test3.in │ │ ├── test3.out │ │ ├── test30.in │ │ ├── test30.out │ │ ├── test31.in │ │ ├── test31.out │ │ ├── test32.in │ │ ├── test32.out │ │ ├── test33.in │ │ ├── test33.out │ │ ├── test34.in │ │ ├── test34.out │ │ ├── test35.in │ │ ├── test35.out │ │ ├── test36.in │ │ ├── test36.out │ │ ├── test37.in │ │ ├── test37.out │ │ ├── test38.in │ │ ├── test38.out │ │ ├── test39.in │ │ ├── test39.out │ │ ├── test4.in │ │ ├── test4.out │ │ ├── test40.in │ │ ├── test40.out │ │ ├── test41.in │ │ ├── test41.out │ │ ├── test42.in │ │ ├── test42.out │ │ ├── test43.in │ │ ├── test43.out │ │ ├── test44.in │ │ ├── test44.out │ │ ├── test45.in │ │ ├── test45.out │ │ ├── test46.in │ │ ├── test46.out │ │ ├── test47.in │ │ ├── test47.out │ │ ├── test48.in │ │ ├── test48.out │ │ ├── test49.in │ │ ├── test49.out │ │ ├── test5.in │ │ ├── test5.out │ │ ├── test50.in │ │ ├── test50.out │ │ ├── test51.in │ │ ├── test51.out │ │ ├── test52.in │ │ ├── test52.out │ │ ├── test53.in │ │ ├── test53.out │ │ ├── test54.in │ │ ├── test54.out │ │ ├── test55.in │ │ ├── test55.out │ │ ├── test56.in │ │ ├── test56.out │ │ ├── test57.in │ │ ├── test57.out │ │ ├── test58.in │ │ ├── test58.out │ │ ├── test59.in │ │ ├── test59.out │ │ ├── test6.in │ │ ├── test6.out │ │ ├── test60.in │ │ ├── test60.out │ │ ├── test61.in │ │ ├── test61.out │ │ ├── test62.in │ │ ├── test62.out │ │ ├── test63.in │ │ ├── test63.out │ │ ├── test64.in │ │ ├── test64.out │ │ ├── test65.in │ │ ├── test65.out │ │ ├── test66.in │ │ ├── test66.out │ │ ├── test67.in │ │ ├── test67.out │ │ ├── test68.in │ │ ├── test68.out │ │ ├── test69.in │ │ ├── test69.out │ │ ├── test7.in │ │ ├── test7.out │ │ ├── test70.in │ │ ├── test70.out │ │ ├── test71.in │ │ ├── test71.out │ │ ├── test72.in │ │ ├── test72.out │ │ ├── test73.in │ │ ├── test73.out │ │ ├── test74.in │ │ ├── test74.out │ │ ├── test8.in │ │ ├── test8.out │ │ ├── test9.in │ │ ├── test9.out │ │ └── val.cpp │ └── statement.md ├── C │ ├── data │ │ ├── chk.cpp │ │ ├── problem.conf │ │ ├── std.cpp │ │ ├── test1.in │ │ ├── test1.out │ │ ├── test10.in │ │ ├── test10.out │ │ ├── test11.in │ │ ├── test11.out │ │ ├── test12.in │ │ ├── test12.out │ │ ├── test13.in │ │ ├── test13.out │ │ ├── test14.in │ │ ├── test14.out │ │ ├── test15.in │ │ ├── test15.out │ │ ├── test16.in │ │ ├── test16.out │ │ ├── test17.in │ │ ├── test17.out │ │ ├── test18.in │ │ ├── test18.out │ │ ├── test19.in │ │ ├── test19.out │ │ ├── test2.in │ │ ├── test2.out │ │ ├── test20.in │ │ ├── test20.out │ │ ├── test21.in │ │ ├── test21.out │ │ ├── test22.in │ │ ├── test22.out │ │ ├── test23.in │ │ ├── test23.out │ │ ├── test24.in │ │ ├── test24.out │ │ ├── test25.in │ │ ├── test25.out │ │ ├── test26.in │ │ ├── test26.out │ │ ├── test27.in │ │ ├── test27.out │ │ ├── test28.in │ │ ├── test28.out │ │ ├── test29.in │ │ ├── test29.out │ │ ├── test3.in │ │ ├── test3.out │ │ ├── test30.in │ │ ├── test30.out │ │ ├── test31.in │ │ ├── test31.out │ │ ├── test32.in │ │ ├── test32.out │ │ ├── test33.in │ │ ├── test33.out │ │ ├── test34.in │ │ ├── test34.out │ │ ├── test35.in │ │ ├── test35.out │ │ ├── test36.in │ │ ├── test36.out │ │ ├── test37.in │ │ ├── test37.out │ │ ├── test38.in │ │ ├── test38.out │ │ ├── test39.in │ │ ├── test39.out │ │ ├── test4.in │ │ ├── test4.out │ │ ├── test40.in │ │ ├── test40.out │ │ ├── test41.in │ │ ├── test41.out │ │ ├── test42.in │ │ ├── test42.out │ │ ├── test43.in │ │ ├── test43.out │ │ ├── test44.in │ │ ├── test44.out │ │ ├── test45.in │ │ ├── test45.out │ │ ├── test46.in │ │ ├── test46.out │ │ ├── test47.in │ │ ├── test47.out │ │ ├── test48.in │ │ ├── test48.out │ │ ├── test49.in │ │ ├── test49.out │ │ ├── test5.in │ │ ├── test5.out │ │ ├── test50.in │ │ ├── test50.out │ │ ├── test51.in │ │ ├── test51.out │ │ ├── test52.in │ │ ├── test52.out │ │ ├── test53.in │ │ ├── test53.out │ │ ├── test54.in │ │ ├── test54.out │ │ ├── test55.in │ │ ├── test55.out │ │ ├── test56.in │ │ ├── test56.out │ │ ├── test57.in │ │ ├── test57.out │ │ ├── test58.in │ │ ├── test58.out │ │ ├── test59.in │ │ ├── test59.out │ │ ├── test6.in │ │ ├── test6.out │ │ ├── test60.in │ │ ├── test60.out │ │ ├── test61.in │ │ ├── test61.out │ │ ├── test62.in │ │ ├── test62.out │ │ ├── test63.in │ │ ├── test63.out │ │ ├── test64.in │ │ ├── test64.out │ │ ├── test65.in │ │ ├── test65.out │ │ ├── test66.in │ │ ├── test66.out │ │ ├── test67.in │ │ ├── test67.out │ │ ├── test68.in │ │ ├── test68.out │ │ ├── test69.in │ │ ├── test69.out │ │ ├── test7.in │ │ ├── test7.out │ │ ├── test70.in │ │ ├── test70.out │ │ ├── test71.in │ │ ├── test71.out │ │ ├── test72.in │ │ ├── test72.out │ │ ├── test73.in │ │ ├── test73.out │ │ ├── test74.in │ │ ├── test74.out │ │ ├── test75.in │ │ ├── test75.out │ │ ├── test76.in │ │ ├── test76.out │ │ ├── test77.in │ │ ├── test77.out │ │ ├── test78.in │ │ ├── test78.out │ │ ├── test8.in │ │ ├── test8.out │ │ ├── test9.in │ │ ├── test9.out │ │ └── val.cpp │ └── statement.md └── report │ ├── .gitignore │ └── report.tex ├── part2 ├── agc020_d.cpp ├── agc020_e.cpp ├── agc020_f.cpp ├── agc022_e.cpp ├── agc023_e.cpp ├── agc023_f.cpp ├── agc024_d.cpp ├── agc024_e.cpp ├── agc025_d.cpp ├── agc026_d.cpp ├── agc026_e.cpp ├── agc027_d.cpp ├── agc027_f.cpp ├── agc028_c.cpp ├── agc028_d.cpp ├── agc029_c.cpp ├── agc029_e.cpp ├── agc029_f.cpp ├── agc030_c.cpp ├── agc030_d.cpp ├── agc030_f.cpp ├── agc031_d.cpp ├── agc032_c.cpp ├── agc032_d.cpp ├── agc032_e.cpp ├── agc033_d.cpp ├── agc033_e.cpp ├── agc034_d.cpp ├── agc034_e.cpp ├── agc034_f.cpp ├── agc035_c.cpp ├── agc035_d.cpp ├── agc036_d.cpp ├── agc036_f.cpp ├── agc037_d.cpp ├── agc037_e.cpp ├── agc038_e.cpp ├── agc038_f.cpp ├── agc039_d.cpp ├── agc039_e.cpp ├── agc039_f.cpp ├── arc091_f.cpp ├── arc093_e.cpp ├── arc093_f.cpp ├── arc095_f.cpp ├── arc096_e.cpp ├── arc096_f.cpp ├── arc097_f.cpp ├── arc099_f.cpp ├── arc100_f.cpp ├── arc101_e.cpp ├── arc101_f.cpp ├── arc102_f.cpp ├── arc103_d.cpp ├── arc103_f.cpp ├── cf506C.cpp ├── cf506E.cpp ├── cf512D.cpp ├── cf521D.cpp ├── cf547D.cpp ├── cf555E.cpp ├── cf559E.cpp ├── cf566C.cpp ├── cf575A.cpp ├── cf585E.cpp ├── cf587F.cpp ├── cf603E.cpp ├── cf605E.cpp ├── cf611H.cpp ├── cf671D.cpp ├── cf674F.cpp ├── cf674G.cpp ├── cf704D.cpp ├── cf708D.cpp ├── cf708E.cpp └── checklist.md └── part3 ├── .gitignore ├── final ├── noithesis.cls └── 李白天.tex ├── image1.png ├── share.tex └── slide.tex /.gitattributes: -------------------------------------------------------------------------------- 1 | *.in filter=lfs diff=lfs merge=lfs -text 2 | *.out filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /part1/A/data/problem.conf: -------------------------------------------------------------------------------- 1 | n_tests 10 2 | input_pre test 3 | input_suf in 4 | output_pre test 5 | output_suf out 6 | time_limit 4 7 | memory_limit 256 8 | use_builtin_judger on 9 | use_builtin_checker fcmp 10 | n_ex_tests 0 11 | n_sample_tests 0 12 | -------------------------------------------------------------------------------- /part1/A/data/std.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/A/data/test1.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e5851cc2d627bb55f91f927a06c30fb3edb55f44ba961f0c8498efe4684c801 3 | size 1778 4 | -------------------------------------------------------------------------------- /part1/A/data/test1.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:40bf71b8e3a5a7ec355685bbdb3e969024f3a59c7fce7310371e7bc002488267 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test10.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b12fab22683c79d8f30be0461a4962ab066f69c3f91c9bd8d5b453ed019aad6 3 | size 1781 4 | -------------------------------------------------------------------------------- /part1/A/data/test10.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:24cc3e2942080ed958a7008b59dd4934fdf516bf978af632998dcab0338960d9 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test2.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ed32adf0e8c0c7df007b96bdb3a41b187c1fc61719bc9778e54a8df38b309649 3 | size 1782 4 | -------------------------------------------------------------------------------- /part1/A/data/test2.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33b23f3e0ce9f179085c9c28d4eecd37dddc740ea3f4fe4a6cd8fb6aa9b681e7 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test3.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e0aafc4430c104f877d30d14c968b17cadb1516b2fe905233d960e6f0a97d1ce 3 | size 1788 4 | -------------------------------------------------------------------------------- /part1/A/data/test3.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb25ddf54aba8858d653e14c89c09e8d9b6a5f368cc04278e351280f873fecb5 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test4.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fc49e2b042d0b5bf6d03351c6ba164c1132204d54c8ed9eef84827fe23f69202 3 | size 1781 4 | -------------------------------------------------------------------------------- /part1/A/data/test4.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:77caabbcdc02cea9045161f1635fb5cbeb80d112a11459929a7c4049a8204613 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test5.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6f8c889a6e6e5a62863a9b56eaddd4b69667df4b31fc0fbadfc051dd8865235e 3 | size 1780 4 | -------------------------------------------------------------------------------- /part1/A/data/test5.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96f703e40435abd380bd3ccc224ac40015b8936e390c7a4d05499709c7334e28 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test6.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28dc4f1167d33985188297cbd4700ba8fa1e442dc0ae54796d07bdd07ed1ad1f 3 | size 1788 4 | -------------------------------------------------------------------------------- /part1/A/data/test6.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:351464a79f61cd135dc61104446c29a11c4f8cbb293a2397ff6e6b1052a78320 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test7.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e06a6d3c71fe93b2337634ba20b2c311c65d6a1e22b8ba3e7dc554f8f5b765ce 3 | size 1780 4 | -------------------------------------------------------------------------------- /part1/A/data/test7.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d451db456650cf57339ec544ac856294bd013bc99caa1434c82dd7085da82d4 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test8.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a4c9b95812fb2e07058effc6cd22c8a943487578c258e1bd4b70d020c3020129 3 | size 1780 4 | -------------------------------------------------------------------------------- /part1/A/data/test8.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f6c6bf2d8b7d8d6d21cdc85519de3539204d0bc193f334e923cf0cfe11826529 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/test9.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f4446836484428570847482e14d43628eeecd74a65ba9bb12983e62b4da8aa71 3 | size 1778 4 | -------------------------------------------------------------------------------- /part1/A/data/test9.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:265c7f34c31590334d962576797502bc2efde61ceb6654e602432e768d28c709 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/A/data/val.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/A/statement.md: -------------------------------------------------------------------------------- 1 | # Codeforces 559E Gerald and Path 2 | 3 | 时间限制:$4\texttt{s}$,空间限制:$256\texttt{MB}$ 4 | 5 | ### 题目描述 6 | 7 | Gerald 国的主步行道是绝对笔直的,并且是严格从北向南的,它是如此之长以至于从任何一个方向都走不到尽头。Gerald 国人喜欢在任何时候在这条路上散步,所以这座城市的市长让 Herald 用一些聚光灯把这条路照亮。聚光灯已经被放置在了一些位置并且 Gerald 是不会移动它们的。每台聚光灯能够照亮道路上给定长度的一条线段,且线段的一端必须是该聚光灯的位置,它的方向可以选择是朝南照亮还是朝北照亮。 8 | 9 | 在这条道路上还有一座纪念馆,你可以从纪念馆往道路的两个方向前进,但是纪念馆的南边没有聚光灯。 10 | 11 | 现在给你每个聚光灯的位置和功率,请帮助 Gerald 给每个聚光灯指定照亮的方向,使得被照亮的道路总长最大。 12 | 13 | ### 输入格式 14 | 15 | 第一行输入一个正整数 $n (1\le n\le 100)$,表示聚光灯的数量。接下来 $n$ 行每行输入两个整数,用空格隔开,$a_i, l_i (0\le a_i\le 10^8, 1\le l_i\le 10^8)$,表示第 $i$ 个聚光灯在纪念馆北边的距离,以及该聚光灯能朝一个方向照亮的长度。 16 | 17 | 保证 $a_i$ 互不相同。 18 | 19 | ### 输出格式 20 | 21 | 输出一个整数,表示最大化的被照亮道路总长。 22 | 23 | ### 样例一 24 | 25 | #### input 26 | 27 | ```plain 28 | 3 29 | 1 1 30 | 2 2 31 | 3 3 32 | ``` 33 | 34 | #### output 35 | 36 | ```plain 37 | 5 38 | ``` 39 | 40 | ### 样例二 41 | 42 | #### input 43 | 44 | ```plain 45 | 4 46 | 1 2 47 | 3 3 48 | 4 3 49 | 6 2 50 | ``` 51 | 52 | #### output 53 | 54 | ```plain 55 | 9 56 | ``` 57 | -------------------------------------------------------------------------------- /part1/B/data/problem.conf: -------------------------------------------------------------------------------- 1 | n_tests 74 2 | input_pre test 3 | input_suf in 4 | output_pre test 5 | output_suf out 6 | time_limit 2 7 | memory_limit 1024 8 | use_builtin_judger on 9 | use_builtin_checker fcmp 10 | n_ex_tests 0 11 | n_sample_tests 0 12 | -------------------------------------------------------------------------------- /part1/B/data/std.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/B/data/test1.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3d01dc05dc6f7b02884ba18b6981dea234732cffb30e59d82396d59b589a1cf2 3 | size 4962 4 | -------------------------------------------------------------------------------- /part1/B/data/test1.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e272854dafd2508504cb51d38463ac4b9d9f082929ddfd22fbe68ede374e4e8 3 | size 4955 4 | -------------------------------------------------------------------------------- /part1/B/data/test10.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09a7fc1850b9486590aef02467edf3c3730602e19a1268f2d91d2e80098d7b7a 3 | size 4767 4 | -------------------------------------------------------------------------------- /part1/B/data/test10.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ad92e8ba8f14aee3db7128d7302bda43b2b028704f7542e5469e272ea7285b4 3 | size 4760 4 | -------------------------------------------------------------------------------- /part1/B/data/test11.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a884e900d0824f5ead8fa5019a4a3be163a2f55c65b65ed0159dae2e40dbae1 3 | size 4741 4 | -------------------------------------------------------------------------------- /part1/B/data/test11.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c80f7f0393e77145ef46cbf10bc2d729e42027e51eabba901f7f37af41b0c63a 3 | size 4733 4 | -------------------------------------------------------------------------------- /part1/B/data/test12.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:371ccb9efe354e73b4e62764b5315f51c59d29d5776cc81e393c7f6b308d55d3 3 | size 4624 4 | -------------------------------------------------------------------------------- /part1/B/data/test12.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e3ad664a109481cd694dfa1282956b91acf377b31b80542e799659f1c775970 3 | size 4616 4 | -------------------------------------------------------------------------------- /part1/B/data/test13.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e7c919b88454ad1f2a6d1354880cf4c9178b35c5c63c73b90d3c20c5173612e9 3 | size 4918 4 | -------------------------------------------------------------------------------- /part1/B/data/test13.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3c024203e91b65d3f93ac45cef70f5759804eca8d356a8de4af798d851f91300 3 | size 4911 4 | -------------------------------------------------------------------------------- /part1/B/data/test14.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b3dc36464ba0f1e85305f91095994c9519b0a41ebffbcc5e8dbb8f18b8ef5f6 3 | size 4826 4 | -------------------------------------------------------------------------------- /part1/B/data/test14.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c2b582c28a4823d6db4d93d8fea81c857231e2ba8b5d9b068873700a730ef92 3 | size 4819 4 | -------------------------------------------------------------------------------- /part1/B/data/test15.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:50e08eb2c44a3a9c70ca51a9ce530a5bbcb35fceb54bba2e20b4837a31f17b60 3 | size 4314 4 | -------------------------------------------------------------------------------- /part1/B/data/test15.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:116382e0465dbce42a054be6042ef97fb53e9fb5d2dbef63edaaa04b62545d5d 3 | size 4307 4 | -------------------------------------------------------------------------------- /part1/B/data/test16.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9395fdb22adef1eac27ebd5162bc829070ef263ce787dbcf5cd13c8fa11c2ff 3 | size 4845 4 | -------------------------------------------------------------------------------- /part1/B/data/test16.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1264f660832d2497ebd09b8dc51c2fa6ca2a20b347702d350f1b0db963770974 3 | size 4838 4 | -------------------------------------------------------------------------------- /part1/B/data/test17.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c9178c68020ebf67b896543992fbcbc5b373144814a53e72c612136b8fa63e2 3 | size 4551 4 | -------------------------------------------------------------------------------- /part1/B/data/test17.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b4ea69a872067fe706189fd5b11a0707035482bd2a99247c2c8514b63217cea7 3 | size 4544 4 | -------------------------------------------------------------------------------- /part1/B/data/test18.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9afc6f360315fd95808a3a7e6cc14c10f63b21528cd4b303f8d58ae5dd154478 3 | size 4804 4 | -------------------------------------------------------------------------------- /part1/B/data/test18.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9bff06d697494ee9f3159d5ffe519593f69a4a8e3124b18702ebe7a3e4cebcca 3 | size 4797 4 | -------------------------------------------------------------------------------- /part1/B/data/test19.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1df463dfe5b5842f1c8262fc9ad6dd954c17d26c36af5671e8ad5d8d7165ed30 3 | size 4994 4 | -------------------------------------------------------------------------------- /part1/B/data/test19.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca0a23d62184439d440f3d42787bfe323012e7a22605cddf9dbe855ee67bafd5 3 | size 4987 4 | -------------------------------------------------------------------------------- /part1/B/data/test2.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:218897bc9b16e852769b1b13b12d0c924f3ffb131990315a46e05a2cd3e73574 3 | size 4096 4 | -------------------------------------------------------------------------------- /part1/B/data/test2.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:560ddcd07d10d06ceb2c7c9063412c639a75a58ca2fa02eabd1a2c991775e459 3 | size 4089 4 | -------------------------------------------------------------------------------- /part1/B/data/test20.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1287ae9f7acde30d3505367067c3a3c846fb68c46edd8c1a200461127b1dd01c 3 | size 4740 4 | -------------------------------------------------------------------------------- /part1/B/data/test20.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:746b3d74ad001fa14bc14f535ff5f356f7782251669da3c8c17ab9a5087e1422 3 | size 4733 4 | -------------------------------------------------------------------------------- /part1/B/data/test21.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:31379dec2acae80035862268a68c04b13f2cb024011c3844bb6dad5269655217 3 | size 4088 4 | -------------------------------------------------------------------------------- /part1/B/data/test21.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f8778c8547dd92c32ae1286795e3042ac76bc4601450441a2f8f1ef0085f7f2 3 | size 4081 4 | -------------------------------------------------------------------------------- /part1/B/data/test22.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8089006f7a5c90572c609722e240654b1a716ed46edf7da86d63e9fe615dc4f3 3 | size 4774 4 | -------------------------------------------------------------------------------- /part1/B/data/test22.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca8db629de74ad069acf78167c5d259d032d34ce1ef4ba4b9bdd282c840390e7 3 | size 4767 4 | -------------------------------------------------------------------------------- /part1/B/data/test23.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:25ab6ddece1aee70be0bf1a22e98beeba51293afea03a91ff933482834395001 3 | size 4728 4 | -------------------------------------------------------------------------------- /part1/B/data/test23.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:df5b22b0dcd7fe461c381781a7a307d7852779926a5acea40aa4bb4dbb89b623 3 | size 4721 4 | -------------------------------------------------------------------------------- /part1/B/data/test24.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66cc40a836dd7948dfced54540ec3b22cf005af4637c62b4af5a8d58bda77a6b 3 | size 4835 4 | -------------------------------------------------------------------------------- /part1/B/data/test24.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79e6f0723cbf362aab70ebb7f8b27132d08fc36608f61aeefc64748eb66354d1 3 | size 4828 4 | -------------------------------------------------------------------------------- /part1/B/data/test25.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:11e601bc91b20bee6c047a0eefc58d5cb4efc55a89d3973b6145f7e2b83f30ba 3 | size 4962 4 | -------------------------------------------------------------------------------- /part1/B/data/test25.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2952fd24caf7d4c9b6f0fad21872448c6f4a359d4dcda3a3e01e9e3df9240d0d 3 | size 4955 4 | -------------------------------------------------------------------------------- /part1/B/data/test26.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:92d6fe39c9c1418fb7128e8d65d0ccea4c2aa0869959bffc54195eee142c6227 3 | size 4785 4 | -------------------------------------------------------------------------------- /part1/B/data/test26.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:52eee0d76dbf2015f5c0d66422d091369b725771f91726254d83e793acd571fe 3 | size 4777 4 | -------------------------------------------------------------------------------- /part1/B/data/test27.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d5dd690432c0b76ecae49961c0f1c286624c7f7c2ef5d1f5231814d8303a5a36 3 | size 4836 4 | -------------------------------------------------------------------------------- /part1/B/data/test27.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3d24e19eb3ad66d66abc1feb2d76b3b3a00e998845be6392c5b28b0dc7d3ca6b 3 | size 4828 4 | -------------------------------------------------------------------------------- /part1/B/data/test28.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca41c7d835a64fa3303765db7c0f5a97e74a213805ebfdfa63e85cc1de0457b9 3 | size 4883 4 | -------------------------------------------------------------------------------- /part1/B/data/test28.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ba49d73d29ce2a2d474b13c8ba032a8da0804fba1019acef6129d671de7b9423 3 | size 4876 4 | -------------------------------------------------------------------------------- /part1/B/data/test29.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7df3c81f2b7c287996dce12454a54d23124c4f5046a5ddd004846eb8bb967f43 3 | size 4962 4 | -------------------------------------------------------------------------------- /part1/B/data/test29.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf35303dc0eb4efa326c3092613bd01b9f1cd6677352e97d70c520c9e7334f19 3 | size 4955 4 | -------------------------------------------------------------------------------- /part1/B/data/test3.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ff5d6a5eec295d6917b5a44444f887b84ba7e66c7551fa73ea4e5e0bd430b4b 3 | size 4399 4 | -------------------------------------------------------------------------------- /part1/B/data/test3.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a9ee5c20e9df24ab320dad1b8fe49d6476ff56b5e20bd70e8c480d7b128b3f17 3 | size 4392 4 | -------------------------------------------------------------------------------- /part1/B/data/test30.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7f2f4985a5e13e8556816e7540f36be525b050b4ccdadffa2f1fbbfba9fc921e 3 | size 4347 4 | -------------------------------------------------------------------------------- /part1/B/data/test30.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:915c5178dad70cdafa73baa2de6ab2e1dd6fae92a260d34f97057b39bfc14f0b 3 | size 4340 4 | -------------------------------------------------------------------------------- /part1/B/data/test31.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8441ba84cc40e22b41850e337b92479e8627a418bbd7c33e985e05cd252acd95 3 | size 4920 4 | -------------------------------------------------------------------------------- /part1/B/data/test31.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afee417cf31ad273abee09a0b2c74953d633f88c5ba4144142953b5d1e2a729b 3 | size 4913 4 | -------------------------------------------------------------------------------- /part1/B/data/test32.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3ea109bf0bf25fda120a19f20b68482f31b67c374d83218c634cb6bd6a6e61d2 3 | size 4904 4 | -------------------------------------------------------------------------------- /part1/B/data/test32.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b3e33a9473b1f053dfe32479db5f145c5660b8dfa4917085256f975c1a943e9c 3 | size 4897 4 | -------------------------------------------------------------------------------- /part1/B/data/test33.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b3b13eb4ee38ddbbaffcce29b6eb9849b678fb8bd84cae1d77e564e0f2d2853 3 | size 4572 4 | -------------------------------------------------------------------------------- /part1/B/data/test33.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3977b056792be9d43ad5e64e49e1599785d3efb2a14aa3d6070476d789f49481 3 | size 4565 4 | -------------------------------------------------------------------------------- /part1/B/data/test34.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7d49f2c3d912a9d2f934f11595d8b07c34532e038d96713dd53ad163a231e982 3 | size 4715 4 | -------------------------------------------------------------------------------- /part1/B/data/test34.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:324d21582732033c01de00183d9213515c65f2cae6bd00a3fe187598abe87ec2 3 | size 4707 4 | -------------------------------------------------------------------------------- /part1/B/data/test35.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e1fb8c83c71e4cfdbf03d664b71e8a157ddea8e166dff967b58a9583994149ad 3 | size 4857 4 | -------------------------------------------------------------------------------- /part1/B/data/test35.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:39fce5851c970be5f3bb5959c19ee2abb457414b539ef8e99040e1752e2f5fde 3 | size 4849 4 | -------------------------------------------------------------------------------- /part1/B/data/test36.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:80029b6d077a1112bcaefe58f1e91eb41dbb6db02fb8ab40275c8442facbfc67 3 | size 4150 4 | -------------------------------------------------------------------------------- /part1/B/data/test36.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2076551916cca09af178fd70deeef477405e20ed9648a333c94c518dc88c82d7 3 | size 4142 4 | -------------------------------------------------------------------------------- /part1/B/data/test37.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eef3c30030cfa4631b90fb22ea3d52d527490b1c4c90f4a023c6889eee45bb2c 3 | size 4775 4 | -------------------------------------------------------------------------------- /part1/B/data/test37.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e08d507c65fc7e0a7909fda4f631274ddb34c5c063aee995d6fae075d17985d 3 | size 4768 4 | -------------------------------------------------------------------------------- /part1/B/data/test38.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:83249f2cd2ea30b83e9854512b2427c7ebab05e9adaf74cdac19e46864670992 3 | size 4724 4 | -------------------------------------------------------------------------------- /part1/B/data/test38.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fdc6f3835da89158371c29be7822b47614395aead19c59a41ad1431d25053fb3 3 | size 4717 4 | -------------------------------------------------------------------------------- /part1/B/data/test39.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b7ff7492059a771daa1ff8a41fc82b7be68a455231afb7ea0231675a22ddfe1 3 | size 4222 4 | -------------------------------------------------------------------------------- /part1/B/data/test39.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ace8e8222826ed71436b587b5a8b1d810338b113b9d4fe4e490fa834e8fc2bc7 3 | size 4214 4 | -------------------------------------------------------------------------------- /part1/B/data/test4.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:74610474df1e29fdbf56a0b9cbbd78455803bd30957f3c45f606c4ab8f27cdc5 3 | size 4149 4 | -------------------------------------------------------------------------------- /part1/B/data/test4.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afbdfa4ae80b601536d01b9d6d56ab18c92fe0f26e1b004b9ff7ee5731d2147e 3 | size 4142 4 | -------------------------------------------------------------------------------- /part1/B/data/test40.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:71b11ce6cdaa186bd285cf432e256bc6f38eaf1fbf145129004ee1589549aceb 3 | size 4865 4 | -------------------------------------------------------------------------------- /part1/B/data/test40.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3db38c861f0ce749966d047e1f0db4a97579e1b4014f01fe50d400d8f7d180ef 3 | size 4857 4 | -------------------------------------------------------------------------------- /part1/B/data/test41.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3986893f6facc166310bc393744360dd8d131782528b4e27dd34fbcc0ae36747 3 | size 4720 4 | -------------------------------------------------------------------------------- /part1/B/data/test41.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1ad008b6b051e18585e5153a133b3377fc7b0ee926e86bb50476bd76b5c82aba 3 | size 4712 4 | -------------------------------------------------------------------------------- /part1/B/data/test42.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9c76849fc9803a701c9757ea636247d2a65aa91ba95183203936310a526a16f 3 | size 4396 4 | -------------------------------------------------------------------------------- /part1/B/data/test42.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b863ac3cd05db4d9bf3a7011cb9e241668d3936fc1dc6510f7566c3bac27606a 3 | size 4389 4 | -------------------------------------------------------------------------------- /part1/B/data/test43.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fe0d1eee23e7f054371ef379b1c86b1d39078af7f316c4a85fca82fa5aca7eda 3 | size 4716 4 | -------------------------------------------------------------------------------- /part1/B/data/test43.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66adde30c30acd4a5c0dd8d4aa3d7cd70914518bdeed5623dd76fbcd8667785d 3 | size 4709 4 | -------------------------------------------------------------------------------- /part1/B/data/test44.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:679b6fc28e52a55e150d052ac6da6e1af8bb9a7648a9b4343e73e4bb30751cdc 3 | size 4532 4 | -------------------------------------------------------------------------------- /part1/B/data/test44.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:533a26aa19afe87689a56e20fbac32467d35d3a6f5268c9ed8b7bfd037c63549 3 | size 4525 4 | -------------------------------------------------------------------------------- /part1/B/data/test45.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:925a87ea61c2033180ff461d1e15bb6f8b4173841c704a094e29b15af65dc95c 3 | size 4371 4 | -------------------------------------------------------------------------------- /part1/B/data/test45.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:92c8b7f91f26f80da754a7f0ebb7304a70587af9cd5b66d996e2e59e9b84441d 3 | size 4363 4 | -------------------------------------------------------------------------------- /part1/B/data/test46.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3dae3c6cd17ec55613ece2c93d309ece4df4a0626fc5bd2cd93f37960f1d2572 3 | size 4563 4 | -------------------------------------------------------------------------------- /part1/B/data/test46.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aed456247e4bd9b092af4ecf53c5c0957072853f37899a4ade3e364b26b68c2a 3 | size 4555 4 | -------------------------------------------------------------------------------- /part1/B/data/test47.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0cd986053032ab9b2cbe4906bfd16861acd168490e912e5f551890258653eaa6 3 | size 4496 4 | -------------------------------------------------------------------------------- /part1/B/data/test47.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c96000e7c3a1b15152625cef80230b60ece4921200218d847507ad5408a5e8f9 3 | size 4489 4 | -------------------------------------------------------------------------------- /part1/B/data/test48.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41de8d03f7fa6d3a39bf825952aa80b44355a93f4e08034fb3a831598ea262e7 3 | size 4377 4 | -------------------------------------------------------------------------------- /part1/B/data/test48.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:44384aed24f1d23be5a25ee41cbe7c77615fa1b2ed26b67d7f4143cbfda117c2 3 | size 4370 4 | -------------------------------------------------------------------------------- /part1/B/data/test49.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1bb4e1f834cba03198d831adfe80355134e2c6c54aee742de897320726425052 3 | size 4763 4 | -------------------------------------------------------------------------------- /part1/B/data/test49.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5bf765945178277d745f136325b4b27c60e7c78b1cc5d2d271ee400013145a5f 3 | size 4756 4 | -------------------------------------------------------------------------------- /part1/B/data/test5.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f7d13888f52532c5b04cee62f0228a763836babed82539986a1bd98ae3c3779 3 | size 4446 4 | -------------------------------------------------------------------------------- /part1/B/data/test5.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:54103fc19dc9f0f7466998879e2ff249b0b3dc32345a90816002870160c598c3 3 | size 4439 4 | -------------------------------------------------------------------------------- /part1/B/data/test50.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:947566cb5b083cbcafc3e52b04d5f5036a0e3bbde4adcb2d5850f7ce49edda02 3 | size 4442 4 | -------------------------------------------------------------------------------- /part1/B/data/test50.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a6cf4564f70a031f8a7da1d6ef7a708794583e43925a3479a21371785de0ced 3 | size 4435 4 | -------------------------------------------------------------------------------- /part1/B/data/test51.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7883d47855a5a62cb179670af7741c4c0a6f19db900428a6ea537702a8791824 3 | size 4031 4 | -------------------------------------------------------------------------------- /part1/B/data/test51.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4fd9ff1b2716854ff5b7bda92d1bd707d8df84aea66a59de5fa27a79d17570db 3 | size 4024 4 | -------------------------------------------------------------------------------- /part1/B/data/test52.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6240b9891fed877391d0ed4023de792d065057baae99e1455cdb78ea68ea19a 3 | size 4768 4 | -------------------------------------------------------------------------------- /part1/B/data/test52.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f2e18eb7cc3c6fa5ff7285e4637ef4bf97dfb3335534dbc9d45096f7939c4e2 3 | size 4760 4 | -------------------------------------------------------------------------------- /part1/B/data/test53.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d865a54bd7cbd778bff0bcc1916920e8bd23d7a01c367aec9449edacce637255 3 | size 4149 4 | -------------------------------------------------------------------------------- /part1/B/data/test53.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c2af08d182908c6acf05c81dea9deef3319d92a78fbe8fbe0cfe81b7228d896 3 | size 4142 4 | -------------------------------------------------------------------------------- /part1/B/data/test54.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a20daf13db351805fbb048c97fbcee3cff5b636c777d52bbc6765e2c8b87e22a 3 | size 4362 4 | -------------------------------------------------------------------------------- /part1/B/data/test54.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b02456871fe4c5eebe68f13e5140e993de371d70c2a4adb76d18ab3e12c07de2 3 | size 4355 4 | -------------------------------------------------------------------------------- /part1/B/data/test55.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:49d5d4d9cc17500fe65b76a53d5abba3cb97e824749f2f6039ffca88eb38b7ac 3 | size 4798 4 | -------------------------------------------------------------------------------- /part1/B/data/test55.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8068e34de319495c3d5c4f20868ed9c168ae4dba2670d33713cb588455eecf4d 3 | size 4791 4 | -------------------------------------------------------------------------------- /part1/B/data/test56.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:868293e674a728fee9e63bc4c817f8a0e3512c0da241530cb832970251392b69 3 | size 4893 4 | -------------------------------------------------------------------------------- /part1/B/data/test56.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3f984cf5cc11017c25d621e8b4c235b916e7cc3ed3c543ce5e806e21c0129026 3 | size 4886 4 | -------------------------------------------------------------------------------- /part1/B/data/test57.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c3b5a9ef2630b065d9fc258a5952b5c2b0e2de0df59b899b078e1931b7e3fe89 3 | size 4309 4 | -------------------------------------------------------------------------------- /part1/B/data/test57.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:15436e2ab1299c7baa2f394f319602290e2e209975f763dbc620e7b143dd9f5b 3 | size 4301 4 | -------------------------------------------------------------------------------- /part1/B/data/test58.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f140fe8728b8572f64d24bbd432f80c9ba4aff9dd25f2a16a123d0e86153d08a 3 | size 4009 4 | -------------------------------------------------------------------------------- /part1/B/data/test58.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c7dd7fa1466969d5e211e829bcd21773a13e630220d64cf2721b62690cae1900 3 | size 4001 4 | -------------------------------------------------------------------------------- /part1/B/data/test59.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aa90fc9bd8677f6310b3fe3459dbf85aa49ab99ba51dbf7912dd3149a26f7f34 3 | size 4495 4 | -------------------------------------------------------------------------------- /part1/B/data/test59.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:269fd2e2fca98d28089e18edb2d40cfd9f1a5dc1f017aaa62e2dd4c4ef62ecdf 3 | size 4488 4 | -------------------------------------------------------------------------------- /part1/B/data/test6.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4dafdbc5853c9ed933c25692a71e1104bbd53fe72e8ac40da47e199e0db65883 3 | size 4335 4 | -------------------------------------------------------------------------------- /part1/B/data/test6.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:17cbf9ce80a20a17a002c1d7bb3d36705b075ec68b79a60f056284ef8303ee9b 3 | size 4328 4 | -------------------------------------------------------------------------------- /part1/B/data/test60.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ec856f51f4117ba1d684161ea1a5a2208d59fb7134899f88a654eb536fdeb529 3 | size 4503 4 | -------------------------------------------------------------------------------- /part1/B/data/test60.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:89b158007911740c5b733faf4595dcbe6fbd61471180b4463777156ea3f60f82 3 | size 4496 4 | -------------------------------------------------------------------------------- /part1/B/data/test61.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5419e6a74d78361d6cc4ed789edcce6b45bdc836267d1a2149668301a016987d 3 | size 4917 4 | -------------------------------------------------------------------------------- /part1/B/data/test61.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4938d1e077ba1142bfc90dbdeb5482c24ded9fd6daf8f3bfa626414a0a769a58 3 | size 4910 4 | -------------------------------------------------------------------------------- /part1/B/data/test62.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6694d4cd606a09941a5fad7aedd58f6fd3a593dec5b04f589300599650ab7f0 3 | size 4601 4 | -------------------------------------------------------------------------------- /part1/B/data/test62.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:32bacb4b9d36a8e8e8ab76f036cf45a2c29affe454118500b039a1db2449a9cc 3 | size 4594 4 | -------------------------------------------------------------------------------- /part1/B/data/test63.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:602a806744c6beed8a5845b2f857e54bb042ae414cb9d726a9af3c93acae0158 3 | size 4888 4 | -------------------------------------------------------------------------------- /part1/B/data/test63.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:75de0d95a485ef28b8d73e2958454945ee3ec1d3e8891fea51ead7a55223b0d1 3 | size 4881 4 | -------------------------------------------------------------------------------- /part1/B/data/test64.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d3ea11dfba0e8b2a9126c830a52a96351d2be2eb9f4291a9dd2868c091156fe 3 | size 4602 4 | -------------------------------------------------------------------------------- /part1/B/data/test64.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:242385bb5b7fe29be4e53d64105df376eac65416f5fd9d5ab0bb1398f3c57976 3 | size 4595 4 | -------------------------------------------------------------------------------- /part1/B/data/test65.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6351212b00fbc2600ac07a78c90e884f98fa2bc314f228ca1d2fcd2b78aee4f1 3 | size 4652 4 | -------------------------------------------------------------------------------- /part1/B/data/test65.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:773087c678f2681cb68b6f09e4df3f0ada20fdc7b2c54a958889d07a952df2f6 3 | size 4645 4 | -------------------------------------------------------------------------------- /part1/B/data/test66.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:543eabb00210c5eff6d6ac32ba0b25dc45e417c2e793b847abcdc0c8d33c9372 3 | size 4488 4 | -------------------------------------------------------------------------------- /part1/B/data/test66.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf4247229d13141ba6ad823a99d5f43de800be30eb8c57692287cf1cce26aa14 3 | size 4481 4 | -------------------------------------------------------------------------------- /part1/B/data/test67.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f3083c6b538221c091dae291eee2b147c94cd8b93352ea5c486b0fb74bf2ac1c 3 | size 4567 4 | -------------------------------------------------------------------------------- /part1/B/data/test67.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f9d858927fae14d0b6d025e8759d7d6366de72d3fb0befe8506f679f45724b5d 3 | size 4560 4 | -------------------------------------------------------------------------------- /part1/B/data/test68.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c541fcc957b303d4c4c3c948b4f3a8bf3fa1fcfc5e48a592bd5a747588585d18 3 | size 4917 4 | -------------------------------------------------------------------------------- /part1/B/data/test68.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f1de9d3d84d92d988ea790bddc1ea076e585d8506620f2b7ae737ee686495bd 3 | size 4910 4 | -------------------------------------------------------------------------------- /part1/B/data/test69.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f577df76cb8c36b80d3482e1d63f27f24aaea842f61fdd4e9180b652529deca8 3 | size 4235 4 | -------------------------------------------------------------------------------- /part1/B/data/test69.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:772b65d16afbd57d1babf8a1791bf32f811b704c8ccf7b379faf7bf0b5822cab 3 | size 4228 4 | -------------------------------------------------------------------------------- /part1/B/data/test7.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28d0372ad9f33fee0af66df5f08dfe9652b23a65418b51dcd4ed083771768af4 3 | size 4036 4 | -------------------------------------------------------------------------------- /part1/B/data/test7.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5795700c5b96dcb9847acb1afdc7d7ca847feaea630d1d04ef5a05f2b12585a6 3 | size 4029 4 | -------------------------------------------------------------------------------- /part1/B/data/test70.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12c20f4cb9aefe21ed0afbcbe3b8847f378194c3eeb8636c5958bf93e4579890 3 | size 4258 4 | -------------------------------------------------------------------------------- /part1/B/data/test70.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a165d957c09428e82c03cec355871ecbba2a4a6aa3648ed7707c8619fbde5108 3 | size 4251 4 | -------------------------------------------------------------------------------- /part1/B/data/test71.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7f712a88ffb875e6b692bd15f92df40c0036e7e5208757509d2eba65660707ac 3 | size 5017 4 | -------------------------------------------------------------------------------- /part1/B/data/test71.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c988b1f1ec035437c227eda5329d9ecf3fa16a7507507d0809fc21bbe2ddbf0 3 | size 5001 4 | -------------------------------------------------------------------------------- /part1/B/data/test72.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f7567bb4c09698c754503055bf04487f19bcb8ad43ff75c7362e443ae6396f0c 3 | size 5016 4 | -------------------------------------------------------------------------------- /part1/B/data/test72.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c988b1f1ec035437c227eda5329d9ecf3fa16a7507507d0809fc21bbe2ddbf0 3 | size 5001 4 | -------------------------------------------------------------------------------- /part1/B/data/test73.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:53d82e8480140785e42c316a355402bdb278135af788edb7ee0abcda76b9e2af 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/B/data/test73.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eac20beedd1755a25a93f9922c812e836cd56eb5089ebf3012c54542475f2bf2 3 | size 6 4 | -------------------------------------------------------------------------------- /part1/B/data/test74.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c367af6dfadddd10cbb52f93904aa20e8dcbbefb1c22793065db2633705301a 3 | size 16 4 | -------------------------------------------------------------------------------- /part1/B/data/test74.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5d77fc46984bd5eea6edf6a5e9d9715865dfde67449b4558c87d9d31e867c364 3 | size 11 4 | -------------------------------------------------------------------------------- /part1/B/data/test8.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d7d0e5380b75a5670e1cb0a10e4d40dccac3487fd777f7b5f9f2f1b596633d10 3 | size 4023 4 | -------------------------------------------------------------------------------- /part1/B/data/test8.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f8e781f1cf02d2a8d7e394a9a1e3ea3a2087047fc9c10ebdcb533fffad93ed64 3 | size 4016 4 | -------------------------------------------------------------------------------- /part1/B/data/test9.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:922e3fe3599e5e3f919f5785c2fd6f74ac16c3cd133392db739d6ebff3a613e2 3 | size 4523 4 | -------------------------------------------------------------------------------- /part1/B/data/test9.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c8bfd09b3d1af1b8b7b0d37fee11c4c023d1c4aeb182d0b64dffaf20218a1c84 3 | size 4515 4 | -------------------------------------------------------------------------------- /part1/B/data/val.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/B/statement.md: -------------------------------------------------------------------------------- 1 | # agc037e Reversing and Concatenating 2 | 3 | 时间限制:$2\texttt{s}$,空间限制:$1024\texttt{MB}$ 4 | 5 | ### 题目描述 6 | 7 | Takahashi 有一个长为 $N$ 的小写英文字符串 $S$。他会在这个字符串上进行 $K$ 次操作: 8 | 9 | - 记 $T$ 为 $S$ 这个字符串翻转后的结构,$U$ 为将 $S$ 和 $T$ 拼接得到的字符串。 10 | - 选取 $S'$ 是 $U$ 的一个长度为 $N$ 的子串,然后将 $S$ 替换掉 $S'$。 11 | 12 | 请你找出将字符串 $S$ 执行 $K$ 次操作后能得到的所有字符串中,字典序最小的那个。 13 | 14 | ### 限制 15 | 16 | - $1\le N \le 5000$ 17 | - $1\le K \le 10^9$ 18 | - $|S| = N$ 19 | - $|S|$ 只包含英文小写字母。 20 | 21 | ### 输入格式 22 | 23 | 输入由以下形式给出: 24 | 25 | > $N$ $K$ 26 | 27 | > $S$ 28 | 29 | ### 输出格式 30 | 31 | 输出一个字符串,表示将字符串 $S$ 执行 $K$ 次操作后能得到的所有字符串中,字典序最小的那个。 32 | 33 | ### 样例一 34 | 35 | #### input 36 | 37 | ```plain 38 | 5 1 39 | bacba 40 | ``` 41 | 42 | #### output 43 | 44 | ```plain 45 | aabca 46 | ``` 47 | 48 | ### 样例二 49 | 50 | #### input 51 | 52 | ```plain 53 | 10 2 54 | bbaabbbaab 55 | ``` 56 | 57 | #### output 58 | 59 | ```plain 60 | aaaabbaabb 61 | ``` 62 | -------------------------------------------------------------------------------- /part1/C/data/chk.cpp: -------------------------------------------------------------------------------- 1 | #include "testlib.h" 2 | #include 3 | 4 | using namespace std; 5 | 6 | const double EPS = 1E-11; 7 | 8 | int main(int argc, char * argv[]) 9 | { 10 | setName("compare two sequences of doubles, max absolute or relative error = %.5f", EPS); 11 | registerTestlibCmd(argc, argv); 12 | 13 | int n = 0; 14 | double j = 0, p = 0; 15 | 16 | while (!ans.seekEof()) 17 | { 18 | n++; 19 | j = ans.readDouble(); 20 | p = ouf.readDouble(); 21 | if (!doubleCompare(j, p, EPS)) 22 | { 23 | quitf(_wa, "%d%s numbers differ - expected: '%.11f', found: '%.11f', error = '%.11f'", 24 | n, englishEnding(n).c_str(), j, p, doubleDelta(j, p)); 25 | } 26 | } 27 | 28 | if (n == 1) 29 | quitf(_ok, "found '%.11f', expected '%.11f', error '%.11f'", p, j, doubleDelta(j, p)); 30 | 31 | quitf(_ok, "%d numbers", n); 32 | } 33 | -------------------------------------------------------------------------------- /part1/C/data/problem.conf: -------------------------------------------------------------------------------- 1 | n_tests 78 2 | input_pre test 3 | input_suf in 4 | output_pre test 5 | output_suf out 6 | time_limit 5 7 | memory_limit 512 8 | use_builtin_judger on 9 | n_ex_tests 0 10 | n_sample_tests 0 11 | -------------------------------------------------------------------------------- /part1/C/data/std.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/C/data/test1.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5599633ba1a71df946de185380b8750518ed309e8b75cfe55fba4780efa5e972 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/C/data/test1.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test10.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7321651b5363195c5170da919779f9c6bd84bb38ed645e04e19043237f55cb93 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test10.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test11.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c1ec51720142e4a0ac8cd7242ecf36ced7b0a438f58c40331706ea66d589519 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test11.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2afaaf8f2b73127c30ff18c3d436043a5b3fd08aa1b026a4402c380ed6d976e9 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test12.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:03bca3ee01ef4f2ef7f565497b14e3e07459f7973c6ac7879241dd0e7f6fefe8 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test12.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3564455ccd501af11c8f70da145d8f1e40effacae5d1fe88960e9cefa0b8a8b2 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test13.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4002e3b282bbca1f329c78920f0cd3259c9de26a65b8f0ecaeccbdb91f3dac6f 3 | size 14 4 | -------------------------------------------------------------------------------- /part1/C/data/test13.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ed166a7b4966ecd4a7fe091b3d76b7edee24d84fadff3c1b1ba7db893da97ef 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test14.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e895b5881f4711f446c792a1d13f1808222ad09502727b2981cca8946f0237fb 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test14.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e502c36b580db7223b5b405cb7df8455f8866deaf12c41d1a219adeaf26fbe4 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test15.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5948a05cc3a8d95a15e41c6dc1f26cc18ab52fd9f0e5e507d3e89fe5cb4be8a7 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test15.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test16.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fec80e12cd927aa3af5e2318aca7c1f8f267f9312b51767f97a5c148246b5664 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test16.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test17.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:10d5888907cb96fac4e544fc217496d31e33b8774ad570c8351ccd9059a391cc 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test17.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:22c81f25321269a4940e85a0d548603874b62b09e6f582b156365a578f4be40f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test18.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:45b0303a6d63131d06476d70e5ea048ce5a15096736442f234304ac8d446eb88 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test18.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:195537d5d760418fb9704061dd885d8b40f7561dd0b0ff4172a42bbabae1d248 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test19.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5eb477ed9c868a77fa2551eebdb6c78d70d9bfefc8959882287e064c63a79221 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test19.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9c2e5b68e5708d2a8d10af95e4360c1f9fb98707bdab541d02122f8fbe3e2284 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test2.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:37c0ade50873353e9ec538aafc6514415999be2f29442880820edc02c6c6f9fa 3 | size 11 4 | -------------------------------------------------------------------------------- /part1/C/data/test2.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test20.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5008c51b258303d1024b9bd30d3d50f2edb6cf5b4aa5f41e4bed9649a33b2da0 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test20.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4769ad0f97eb1b21baf86937cae468fd2b703f5b46908f9159555caae598daed 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test21.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:782c11eaa10bf56c90a0aedd39829334a8fb8dd4c58044bcbbbde89848f21275 3 | size 16 4 | -------------------------------------------------------------------------------- /part1/C/data/test21.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ff6513165fbed7e4338a874fb19443236db099727935f78959d34bf303781374 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test22.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a330da924d97b91ba504be3c8d82acf6e60199968bd94a50e262099cfb65c9d5 3 | size 16 4 | -------------------------------------------------------------------------------- /part1/C/data/test22.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bdf7ae283cf1c48263f6d95ae681e278a8c975bf63c81956f8d606fb1093bb8f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test23.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79aa1e17fe46f7415b91b65d3a2c3f54ae3ad5e488978710e6449a6a593a5438 3 | size 16 4 | -------------------------------------------------------------------------------- /part1/C/data/test23.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:da859bb4a0d1c8860c49275ace22e8f98efbbe57bcffed849566cb7ee2aebad5 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test24.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ad99913604572b024c5f23bf9b8b3c80c78a1a403a6e49d2e06bd8177ff3955b 3 | size 18 4 | -------------------------------------------------------------------------------- /part1/C/data/test24.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d25900bf15c795532a6a16dd671d4727bb9c00bcce490cc3e7c753ceaf1ad1f9 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test25.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a8a67576c1e8206e848e4576c054f10a6eabfce466d32c8d85cf37290ddb1e00 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test25.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test26.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:852076ad8e38ecc7be6e31a7beaebb4953ce8ef6b6beb41c717be78563b0a6ba 3 | size 16 4 | -------------------------------------------------------------------------------- /part1/C/data/test26.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test27.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:553a020b4d1308ccb96dce9f16e3a5d52ab4310c34b3064f8176fa1ee6d6517d 3 | size 17 4 | -------------------------------------------------------------------------------- /part1/C/data/test27.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9a05e0bebfb48e58e51ee35e21691f74cfb69a5f1e7a0946893064539e246243 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test28.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6b8efef64592468dd8b19dbdaa696b80b4304d73c7d4add787769c6d395f68e1 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test28.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:62317e0431b35a17f59c5f6f44c3f0192db78ff2eff453b5a0e428d9b2484810 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test29.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e2d5033a45fe0e03b2d197bc406c9efad4f3429f00a6f7d5d84b5fe7f64b1017 3 | size 18 4 | -------------------------------------------------------------------------------- /part1/C/data/test29.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eeaa3be3f7b9c3fa5426c3096ae120671010faf3608547c35f117361adff426f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test3.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d1994efb8147f97e0823ddbb91f6b8cd73bc601ed43ac734727c36ed451a3822 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test3.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bd85a991ea739a2d02a94b042a4bec8ab1e283234e3dfd68e88e0179628663bf 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test30.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:22357d297774d6a2ce2460e7d798e544450ad23c42202273e8bd7196f4e964dc 3 | size 18 4 | -------------------------------------------------------------------------------- /part1/C/data/test30.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:21a8360250ead351f311ab8d3d65b25cab77a235c24e336f99ec007cc3f1b738 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test31.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd49e8a44452bc62080c43dacea85f5559967c443e4dd78721d87c33bc2ad2a7 3 | size 17 4 | -------------------------------------------------------------------------------- /part1/C/data/test31.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d57551612c6dac0084d5dfe714ee3ab93811a6fb94d58e7a4fd3471bcf94501d 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test32.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dfd0364732b19faa3d77dcde1dc59ef9242228cdc5e13e04f31fc3a3e80e071c 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test32.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2aaec35f28de3629eaf6ad1d72205c2c3f12e74474e303909f1476edc39dce7e 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test33.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88e4f2de7d074743914e201d98c75d81b5d4be9e99624bb2ab63a691091170a7 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test33.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0be774cfd11e4bdcc232099ffe6b79032bcfed2f30219655c0d66a3c3673c710 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test34.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc301d797a64ea8e3e04b9f3942ce40d7363c8661ba93a1dff3058f00a6b9919 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test34.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:86d1be6a6d4ff324e36def383d15e43c670ad0f115bf1a8665b885a765f6eba6 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test35.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9c79624a2f5d2067f09054d9f3ef562216719eceb9f60678f1ec1bbd7758a82 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test35.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:72165811aa2f0eead8013b4bbf72c7a14ac9f7dcfac208220778c384d5c99242 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test36.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c51ace5a603eba6158c1125115ed230939698010aba87e9d96d1e7cf10ff8284 3 | size 17 4 | -------------------------------------------------------------------------------- /part1/C/data/test36.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test37.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1461fd306f5855ea6c8a2d2b237c717a7c29525fee9e4471b9368d2cb1e7acd0 3 | size 18 4 | -------------------------------------------------------------------------------- /part1/C/data/test37.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test38.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:86bfea548d3f2f0623284bbd162c2f808a65ff930d292511c0220b41aab60b15 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test38.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f9c09b1eda7743ace244a6d5622f7e44010a9d1a93ea1e5b73a41d49bc0ded4 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test39.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a6158b3f11f75be2070b006fd7b2a236cd6b2d5f858351877768b377f64212ec 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test39.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d52d24b100494376506be3dfbca0724d56a58cad5ec3d64b6946b808398afce8 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test4.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d699d6ab518ac6d95b505c212fbf7954afd0a8dd215ae8d74297285c5b2b4289 3 | size 18 4 | -------------------------------------------------------------------------------- /part1/C/data/test4.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:70173ecde695d1483192d065798c042e600fb1196372a91d872cfd1bdd704c32 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test40.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e94e6167684312029635e2ab37524ac0d974d50c8041d804577e4fa50cc005dc 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test40.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:726ef7fc1849c6463f9f7bb2f44eb7faecf85d3e4634162754b189890f04a76b 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test41.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c21d255f8308c4263328332d946504cfcd092382fc5ebdad79c1f014e67b185f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test41.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f3a6ab815d1504b1d34b1597118389d1759bc8fa55eaa8bd2e4fa4faefbdb3f0 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test42.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a715360d1b0615bbbf1fa78342b06924d3d6e2c00d873164f66d4367743085b2 3 | size 21 4 | -------------------------------------------------------------------------------- /part1/C/data/test42.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:03105960ad59e5940da0bca25c2e579cb68b9e18ef26c5a1e52a40ce25aaa8c7 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test43.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:83b48c247bbf35cc34ede13f35cfe13652db606ecf8fd1f0326996fb064f1452 3 | size 22 4 | -------------------------------------------------------------------------------- /part1/C/data/test43.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c0235cd7597022b8a019e9d114f7bb5842c7de5166c1848297a994e72a3ad01 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test44.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f94f567f83157bbe77d4da325dfbf4aec00d619ba54f0169173a13fcd454bd65 3 | size 22 4 | -------------------------------------------------------------------------------- /part1/C/data/test44.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9a23dd88bc05155eb8f2671a6fbf6e41103ea5d33b31175740dc4d848ba1e063 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test45.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf618b7eac2e03ed55029790c6d39bed9162a0bfc20be907d4c5fbd209e8857e 3 | size 22 4 | -------------------------------------------------------------------------------- /part1/C/data/test45.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e258d7f916f401d5dc0d1c3c5b19f810c9c2b46c4659f7745cc392d1120e12b1 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test46.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0f65590efd30e06a2d63981b990b82b8cbc7bba227c515c41d122a9422837561 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test46.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:942bbce77016afcebe05a224cbeed150b8fb102c4940b02517a0603635c5cf94 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test47.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0952937a4c97f0ff29e55f80095547baa034c73bfef9a3175dba189279fab6ce 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test47.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6bdea4119601760297c92bb47f5af9e85e3d3b19d1c90a35c43045bad65635f7 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test48.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b3849f7f208d81de9ae5ad770e3afebe28fdf13aa459dd613a27d99fa0836981 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test48.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test49.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6a5714ecc12c9f4d03abe7bd43269cdaa2606e707129c375b57406fe52c7967 3 | size 21 4 | -------------------------------------------------------------------------------- /part1/C/data/test49.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test5.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33a3ad4eee254dbfcad36f0294458987a4005bce09c4166a44f7ff4c16ea39f6 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test5.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test50.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6cb51c8b605d7a307129fdff7c9d06ddd6d5890365bddd14a40dba2259d29eef 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test50.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:753c3d29e6b5a7f44fa1a80f186b62f6e2b8394cb6953d723aa97f57be2f60b9 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test51.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:67d32c2cb2ddbdf3094d402aa5803805c4c30b686ef59b54469925e09a08a64b 3 | size 21 4 | -------------------------------------------------------------------------------- /part1/C/data/test51.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6432a099c7139b4cd2da72e74760ab0b30b8ec667607b9f4ff94bf948f869558 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test52.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:125084c3c89fa411c9a6811b50b5fdc63c822e5f4eda0f8c2395b5f44aac7dcf 3 | size 21 4 | -------------------------------------------------------------------------------- /part1/C/data/test52.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:08be8cbf6cba3cb08a67803cb5be171aa710603cab764831d097678be9ae2a77 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test53.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7bdaaca2682b7f766cfc8d96a7764f0e9d7bd47dafb15e9cc20a22ff67bd1cb3 3 | size 24 4 | -------------------------------------------------------------------------------- /part1/C/data/test53.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c87ee4f5d4114852f4e95759258781c869cecb6f514adb019d5587fb0f76c207 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test54.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:873e9b3f7fdd42b9b9f44ef06d469eaeb1881aafb93b7fe6788a44a853899b39 3 | size 23 4 | -------------------------------------------------------------------------------- /part1/C/data/test54.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b702b2b6bd86a3a189cdfa5491c76b3b4c87b6d77d2158a6e1fffdfe165c41bb 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test55.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:351ab0c222b48dc7dffe6edd6670693b3dae6938dc451e95f2a553d19042c147 3 | size 24 4 | -------------------------------------------------------------------------------- /part1/C/data/test55.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ad04d71f5f4fecebe0514a637c36a794d23df2829c601006b5043a504aa5639b 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test56.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e32ae67424f38531e24e9e3f07c9d990bf983255d51d27afc20a9c8f2fc5760 3 | size 24 4 | -------------------------------------------------------------------------------- /part1/C/data/test56.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5ca6eeb406e82739af39fd42bba118a1d83dd57d9664b1010c9d1576a866ec6f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test57.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b62b7fc8bee7703809ba4baaa9a64d905ee27eb8fd838a99eb89371c4111c09b 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test57.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:85d49c62de9d01bb297c48052678ec223a20a0cbd84b2f4a05430f5f7e6f2dc4 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test58.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:05ca18d5c506cbb9ac436ac716fadaaac354c08013307d344d1a1a2fb0368f14 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test58.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test59.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b99de6a1e4bd036337771748dcd9d33d104c724bee8f0b197a92d5d0a6cbbe57 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test59.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:25f67b47d2b18a1c760e81c4b6ff5325591c7443db07a1c1eaa91bcda71280da 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test6.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2520af970ed2ff7e47e5dace06c0a7468578c0fe92e9a4fbc18427ed11f0fdfa 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test6.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:04a7b1bbe11905a2ccd44bd7d53fac5eecfe113fc3e652a9878589ddc68e3644 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test60.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:84c01e3fce7cae38a5182bce398d6525f98c423e101b1a07ceaac60ca3218e56 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test60.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e3d8e9ff6b4af0575787ff8fca6704550f4fc77f856a795f1e130c94044a1ef4 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test61.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8cd49c8c7c0cefac97019a9264d34d2bc7450e49127943853c6e35fdb1fdce4f 3 | size 19 4 | -------------------------------------------------------------------------------- /part1/C/data/test61.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:25f67b47d2b18a1c760e81c4b6ff5325591c7443db07a1c1eaa91bcda71280da 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test62.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f58ab39f510707084715eecb605062dd6f87f8e92dc0feaef7144fb2f030794 3 | size 23 4 | -------------------------------------------------------------------------------- /part1/C/data/test62.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7cf41797a6b64378a042b1b0179f6cd45a5f607c45c30b6893c33f5e5c8d2b7e 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test63.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0e6b79c4675746f06e9fa60596690c8c8793454ea66a8af62eb076d3a24a958d 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test63.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bd20d8bac8bf5a9eda97d4db5d95db63ab940800be94ca1e377fafb037fc58d8 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test64.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1a117c830eb00c4b35fa082cd2228f7c8efe12bc03d59ebb7a5131d62852e49e 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test64.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:37db9852282b45b5c079395a2283a25d798b008a6e55468b98449998d0d0f535 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test65.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4bc4b49de6da3c0fe62745df3c1d5a90bf18d9b11421a903e752f6dc9ba095fa 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test65.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a566201fb57e521607e3b6659d4875dc00a4c2b61ba2595b29c09eb2c7a43c9 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test66.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:adbcc82e2d0005fc324d63e61b8927ea40cf39915a183b3d0390c05b1466871e 3 | size 23 4 | -------------------------------------------------------------------------------- /part1/C/data/test66.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1bd0f887317a86d4709cb7c245a8ff2b44c150a6bc3cc181154cfc3d8ed1c15f 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test67.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0ad4bd080a8ac148acfb95a4bbd93c9bce5c00c407fc786b01ab8e3aa073b12f 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test67.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b2e2b35931b89888df94d11d99b0b4b03ec61c38e949daf223dfb1d6cfd36807 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test68.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2e4341ccf4d59ee57274d02a98858383188e890a45b3ca37b1a8fb7235ba126d 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test68.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5105672cb2939b123aa7d856354ed306962068ca7a06301246dc328883852383 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test69.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:da043c515087577ce9dae982f6ba1ec0b05269f61f6c69ee517f57e6ce40dfee 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test69.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0221a4bfceff32efdef6827b9b77dd21c237601b2e8f38f2a6bb56a803651d7d 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test7.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:551f8f4356a8ecaeec6b9cc6de38e8522220b250e62f0a630aab360bcd57131f 3 | size 12 4 | -------------------------------------------------------------------------------- /part1/C/data/test7.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test70.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f90105b07a9af372c2203e21dd8be4aa29e8c1e9c3239e4e5f49843b1c98f665 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test70.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:30ce554132470114922215c83dac249406b620c5a01d0f88fee4cc574e4814f9 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test71.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:58ade5990aaeef4911afe7119d558abc3ca845f6d228f6e0290c4ec857502369 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test71.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:da8316650fdcd15123e98535137c9722f758d95fa01649dfae93519a53b6be99 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test72.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b496d8d53cb845adb5749f2b73f9753293e9a0b49b690fedc619f00261afeb25 3 | size 25 4 | -------------------------------------------------------------------------------- /part1/C/data/test72.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:753efe70048af46e6cb5907986dc35f530391c25c9ec3766c78e17f562c3b91d 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test73.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a7028c64128a95593a308e2e1b7aa2247227f24db29fcca3159d9be10c2bffc 3 | size 10 4 | -------------------------------------------------------------------------------- /part1/C/data/test73.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d2ddafb54d19c85224f21420205f829109299e44f4f839d88b8a5388d8aceeec 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test74.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ff97aa13b595c601281661ac0ebdc96a0f8b328b102b8a8e10661eae9dc113b 3 | size 15 4 | -------------------------------------------------------------------------------- /part1/C/data/test74.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b8ed64b3b8c8f7eef0b466504bb1a9511ba66d15dc60cb3dbdc6d3ff35f9eba 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test75.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:467bb71ec55117eec5bbfffebd757e0acbce8b6508ff34e8173643715f10699c 3 | size 14 4 | -------------------------------------------------------------------------------- /part1/C/data/test75.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a86c89c8cd3f9b2bd6c7b4db4571a69097d13db433de6f266b5166c4d2166ea0 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test76.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:431b3211d58f1c10cc16230525ef932647d01a90a3471add2d078877fb4140af 3 | size 12 4 | -------------------------------------------------------------------------------- /part1/C/data/test76.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f0716d3666b0b03b25126a02b8dd9f6d64471c596c79b88ca8eee7bcf734f05 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test77.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:57d3ab73225d2fdba20c35ae9f5acfd7f3706634607bb6746cc54e3b91fbf445 3 | size 14 4 | -------------------------------------------------------------------------------- /part1/C/data/test77.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8ea96ba9bc1bb7c8eee42a3cbeb93bb0a88da6722fefd28a011f83f4b3fed7d1 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test78.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1fb7dd6e955149d2149aca66cfca1d3d90fc00fbf8e6dd11938bfdf897ccc9fc 3 | size 23 4 | -------------------------------------------------------------------------------- /part1/C/data/test78.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d71d4df166658c2ed1371a1fd1a21693a5e9b060a07a48f0800a9359895fc593 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test8.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e70e1e7d61f7b544f6f0f97e9b48b6416d05522bd2722627faf880d67ccf78e 3 | size 12 4 | -------------------------------------------------------------------------------- /part1/C/data/test8.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d7f483a9868b7c170baaa69ecea4ab8894809558eb5e9b20052f36d802765e7c 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/test9.in: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8b1c030e615913665951b71f999479f86065420cb421d485bbaec8c3e5f7f87d 3 | size 13 4 | -------------------------------------------------------------------------------- /part1/C/data/test9.out: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d7f483a9868b7c170baaa69ecea4ab8894809558eb5e9b20052f36d802765e7c 3 | size 20 4 | -------------------------------------------------------------------------------- /part1/C/data/val.cpp: -------------------------------------------------------------------------------- 1 | int main(){} 2 | -------------------------------------------------------------------------------- /part1/C/statement.md: -------------------------------------------------------------------------------- 1 | # agc020f Arcs on a Circle 2 | 3 | 时间限制:$5\texttt{s}$,空间限制:$512\texttt{MB}$ 4 | 5 | ### 题目描述 6 | 7 | 你有一个周长为 $C$ 的圆,接下来你要在这个圆上放 $N$ 条弧,第 $i$ 个弧的弧长为 $L_i$。 8 | 9 | 每个弧 $i$ 都是在圆上均匀放置的:在圆上随机均匀选取一个位置,并将第 $i$ 个圆弧以其为中点放置。 10 | 11 | 注意每个弧的放置放置是互相独立的。例如他们可以任意相交或者一个盖住另一个。 12 | 13 | 请问圆上每个点都被至少一个圆弧覆盖的概率是多少?我们认为圆弧包含其端点。 14 | 15 | ### 限制 16 | 17 | - $2\le N \le 6$ 18 | - $2\le C \le 50$ 19 | - $1\le L_i < C$ 20 | 21 | ### 输入格式 22 | 23 | 输入由以下形式给出: 24 | 25 | > $N$ $C$ 26 | 27 | > $L_1\ L_2\ \dots\ L_N$ 28 | 29 | ### 输出格式 30 | 31 | 输出一个实数表示圆上每个点都被至少一个圆弧覆盖的概率,你的答案被是为正确当且仅当与答案的差不超过 $10^{-11}$。 32 | 33 | ### 样例一 34 | 35 | #### input 36 | 37 | ```plain 38 | 2 3 39 | 2 2 40 | ``` 41 | 42 | #### output 43 | 44 | ```plain 45 | 0.3333333333333333 46 | ``` 47 | 48 | #### explanation 49 | 50 | 两个圆弧的中点距离至少应该是 $1$,因此在周长为 $3$ 的圆上其概率为 $1/3$。 51 | 52 | ### 样例二 53 | 54 | #### input 55 | 56 | ```plain 57 | 4 10 58 | 1 2 3 4 59 | ``` 60 | 61 | #### output 62 | 63 | ```plain 64 | 0.0000000000000000 65 | ``` 66 | 67 | #### explanation 68 | 69 | 即使所有弧的总长恰好为 $C$,即圆上每个点都被至少一个圆弧覆盖这一事件可能发生,其概率也可以是 $0$。 70 | 71 | ### 样例三 72 | 73 | #### input 74 | 75 | ```plain 76 | 4 2 77 | 1 1 1 1 78 | ``` 79 | 80 | #### output 81 | 82 | ```plain 83 | 0.5000000000000000 84 | ``` 85 | 86 | ### 样例四 87 | 88 | #### input 89 | 90 | ```plain 91 | 3 5 92 | 2 2 4 93 | ``` 94 | 95 | #### output 96 | 97 | ```plain 98 | 0.4000000000000000 99 | ``` 100 | 101 | ### 样例五 102 | 103 | #### input 104 | 105 | ```plain 106 | 4 6 107 | 4 1 3 2 108 | ``` 109 | 110 | #### output 111 | 112 | ```plain 113 | 0.3148148148148148 114 | ``` 115 | 116 | ### 样例六 117 | 118 | #### input 119 | 120 | ```plain 121 | 6 49 122 | 22 13 27 8 2 19 123 | ``` 124 | 125 | #### output 126 | 127 | ```plain 128 | 0.2832340720702695 129 | ``` 130 | -------------------------------------------------------------------------------- /part1/report/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dmp 3 | *.dvi 4 | *.fd 5 | *.glo 6 | *.gls 7 | *.hd 8 | *.idx 9 | *.ilg 10 | *.ind 11 | *.ins 12 | *.log 13 | *.out 14 | *.swp 15 | *.synctex.gz 16 | *.synctex.gz(busy) 17 | *.tmp 18 | *.toc 19 | *.ver 20 | *.xdv 21 | *.zip 22 | *.pdf 23 | *~ 24 | -------------------------------------------------------------------------------- /part2/agc020_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | int main() { 48 | #ifdef LBT 49 | freopen("test.in", "r", stdin); 50 | int nol_cl = clock(); 51 | #endif 52 | ios::sync_with_stdio(false); 53 | cin.tie(nullptr); 54 | 55 | int q; 56 | cin >> q; 57 | function query = [&](int a, int b, int c, int d) { 58 | int len = (a + b) / (min(a, b) + 1); 59 | 60 | function pred = [&](int k) { 61 | int useA = k / (len + 1) * len; 62 | if (k % (len + 1)) useA += k % (len + 1); 63 | if (useA > a) return false; 64 | if (k % (len + 1)) 65 | return (b - k / (len + 1) + a - useA) / (a - useA + 1) <= len; 66 | return (b - k / (len + 1) + a - useA + 1) / (a - useA + 1) <= len; 67 | }; 68 | 69 | int l = 0, r = a + b; 70 | while (l < r) { 71 | int mid = ((r - l + 1) >> 1) + l; 72 | 73 | if (pred(mid)) 74 | l = mid; 75 | else 76 | r = mid - 1; 77 | } 78 | 79 | function qc = [&](int k) { 80 | if (k <= l) 81 | return k % (len + 1) == 0 ? 'B' : 'A'; 82 | k = a + b - k + 1; 83 | return k % (len + 1) == 0 ? 'A' : 'B'; 84 | }; 85 | 86 | string ret; 87 | for (int k = c; k <= d; ++k) 88 | ret.push_back(qc(k)); 89 | return ret; 90 | }; 91 | while (q--) { 92 | int a, b, c, d; 93 | cin >> a >> b >> c >> d; 94 | cout << query(a, b, c, d) << '\n'; 95 | } 96 | 97 | #ifdef LBT 98 | LOG("Time: %dms\n", int ((clock() 99 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 100 | #endif 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /part2/agc020_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | typedef __int128 BS; 49 | 50 | const int N = 110, P = 998244353; 51 | 52 | int n; 53 | char s[N]; 54 | 55 | map dp1; 56 | 57 | int dfs(BS bs) { 58 | if (bs == 1) return 1; 59 | if (dp1.count(bs)) 60 | return dp1[bs]; 61 | int ret = dfs(bs >> 1) * ((bs & 1) + 1) % P; 62 | int i = 100; 63 | while (!((bs >> i) & 1)) --i; 64 | BS j = bs ^ (BS(1) << i); 65 | for (int l = 1; l <= i; ++l) { 66 | BS mask = j & ((BS(1) << l) - 1); 67 | for (int k = 2; k * l <= i; ++k) { 68 | mask &= j >> ((k - 1) * l); 69 | ret = (ret + dfs((BS(1) << l) | mask) * (ll)dfs((BS(1) << (i - k * l)) | (j >> (k * l)))) % P; 70 | } 71 | } 72 | return dp1[bs] = ret; 73 | } 74 | 75 | int main() { 76 | ios::sync_with_stdio(false); 77 | cin.tie(nullptr); 78 | 79 | cin >> (s + 1); 80 | n = strlen(s + 1); 81 | for (int i = 1; i <= n; ++i) 82 | s[i] -= '0'; 83 | BS bs(1); 84 | bs <<= n; 85 | for (int i = 0; i < n; ++i) 86 | if (s[i + 1]) 87 | bs |= BS(1) << i; 88 | cout << dfs(bs) << '\n'; 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /part2/agc022_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int P = 1000000007; 48 | 49 | char s[300010]; 50 | 51 | int norm(int x) { return x >= P ? x - P : x; } 52 | 53 | void add(int& x, int y) { 54 | if ((x += y) >= P) 55 | x -= P; 56 | } 57 | 58 | void sub(int& x, int y) { 59 | if ((x -= y) < 0) 60 | x += P; 61 | } 62 | 63 | int main() { 64 | #ifdef LBT 65 | freopen("test.in", "r", stdin); 66 | int nol_cl = clock(); 67 | #endif 68 | ios::sync_with_stdio(false); 69 | cin.tie(nullptr); 70 | 71 | cin >> (s + 1); 72 | int n = strlen(s + 1); 73 | s[0] = '1'; 74 | s[n + 1] = '1'; 75 | vector dp(6); 76 | dp[0] = 1; 77 | for (int i = 0; i <= n + 1; ++i) { 78 | vector newDp(6); 79 | if (s[i] != '1') { 80 | for (int j = 0; j < 6; ++j) 81 | add(newDp[j % 3], dp[j]); 82 | } 83 | if (s[i] != '0') { 84 | for (int j = 0; j < 6; ++j) 85 | add(newDp[j % 3 + 3], dp[j]); 86 | if (i & 1) { 87 | sub(newDp[3], dp[3]); 88 | add(newDp[4], dp[3]); 89 | } else { 90 | sub(newDp[4], dp[4]); 91 | add(newDp[5], dp[4]); 92 | } 93 | } 94 | dp = newDp; 95 | } 96 | cout << dp[5] << '\n'; 97 | 98 | #ifdef LBT 99 | LOG("Time: %dms\n", int ((clock() 100 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 101 | #endif 102 | return 0; 103 | } 104 | -------------------------------------------------------------------------------- /part2/agc023_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | struct Node { 48 | int a, b, x; 49 | 50 | Node() {} 51 | 52 | Node(int a, int b, int x) : a(a), b(b), x(x) {} 53 | 54 | bool operator<(const Node& rhs) const { 55 | if (b * (ll)rhs.a == rhs.b * (ll)a) return x < rhs.x; 56 | else 57 | return b * (ll)rhs.a < rhs.b * (ll)a; 58 | } 59 | }; 60 | 61 | int main() { 62 | #ifdef LBT 63 | freopen("test.in", "r", stdin); 64 | int nol_cl = clock(); 65 | #endif 66 | ios::sync_with_stdio(false); 67 | cin.tie(nullptr); 68 | 69 | int n; 70 | cin >> n; 71 | vector p(n - 1), v(n); 72 | cin >> p >> v; 73 | p.insert(p.begin(), {0, 0}); 74 | v.insert(v.begin(), {0}); 75 | vector f(n + 1); 76 | vector a(n + 1); 77 | for (int i = 1; i <= n; ++i) 78 | a[i] = Node(v[i] == 0, v[i] == 1, i); 79 | iota(f.begin(), f.end(), 0); 80 | function find = [&](int x) { 81 | return f[x] == x ? x : f[x] = find(f[x]); 82 | }; 83 | set heap(a.begin() + 2, a.end()); 84 | ll ans = 0; 85 | for (int rep = 1; rep < n; ++rep) { 86 | Node tmp = *heap.begin(); 87 | heap.erase(heap.begin()); 88 | int y = find(p[tmp.x]); 89 | if (y != 1) heap.erase(a[y]); 90 | ans += a[y].b * (ll)tmp.a; 91 | f[tmp.x] = y; 92 | a[y].a += tmp.a; 93 | a[y].b += tmp.b; 94 | if (y != 1) heap.insert(a[y]); 95 | } 96 | cout << ans; 97 | 98 | #ifdef LBT 99 | LOG("Time: %dms\n", int ((clock() 100 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 101 | #endif 102 | return 0; 103 | } 104 | -------------------------------------------------------------------------------- /part2/agc024_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 110; 49 | 50 | int n; 51 | int maxson[N], dep[N]; 52 | bool vis[N]; 53 | vector g[N]; 54 | 55 | void dfs(int u) { 56 | vis[u] = true; 57 | int sons = 0; 58 | for (int v : g[u]) 59 | if (!vis[v]) { 60 | ++sons; 61 | dep[v] = dep[u] + 1; 62 | dfs(v); 63 | } 64 | maxson[dep[u]] = max(maxson[dep[u]], sons); 65 | } 66 | 67 | int main() { 68 | ios::sync_with_stdio(false); 69 | cin.tie(nullptr); 70 | 71 | cin >> n; 72 | vector> edges; 73 | for (int rep = 1; rep < n; ++rep) { 74 | int u, v; 75 | cin >> u >> v; 76 | g[u].push_back(v); 77 | g[v].push_back(u); 78 | edges.emplace_back(u, v); 79 | } 80 | pair ans(n + 1, 0); 81 | for (int i = 1; i <= n; ++i) { 82 | memset(maxson, 0, sizeof(maxson)); 83 | memset(vis, 0, sizeof(vis)); 84 | memset(dep, 0, sizeof(dep)); 85 | dep[i] = 0; 86 | dfs(i); 87 | int a1 = *max_element(dep + 1, dep + n + 1); 88 | ll a2 = 1; 89 | for (int i = 0; i < a1; ++i) a2 *= maxson[i]; 90 | ans = min(ans, make_pair(a1 + 1, a2)); 91 | } 92 | for (const auto& pr : edges) { 93 | int u = pr.first, v = pr.second; 94 | memset(maxson, 0, sizeof(maxson)); 95 | memset(vis, 0, sizeof(vis)); 96 | memset(dep, 0, sizeof(dep)); 97 | vis[u] = vis[v] = true; dep[u] = dep[v] = 0; 98 | dfs(u); dfs(v); 99 | int a1 = *max_element(dep + 1, dep + n + 1); 100 | ll a2 = 2; 101 | for (int i = 0; i < a1; ++i) a2 *= maxson[i]; 102 | ans = min(ans, make_pair(a1 + 1, a2)); 103 | } 104 | cout << ans.first << ' ' << ans.second << '\n'; 105 | 106 | return 0; 107 | } 108 | -------------------------------------------------------------------------------- /part2/agc024_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define LOG(FMT...) fprintf(stderr, FMT) 12 | 13 | using namespace std; 14 | 15 | typedef long long ll; 16 | 17 | const int N = 310; 18 | int M; 19 | 20 | int n, k; 21 | int binom[N][N], dp[N], sum[N], tmp[N]; 22 | 23 | int norm(int x) { return x >= M ? x - M : x; } 24 | 25 | int main() { 26 | #ifdef LBT 27 | freopen("test.in", "r", stdin); 28 | #endif 29 | 30 | scanf("%d%d%d", &n, &k, &M); 31 | ++n; 32 | for (int i = 0; i <= n; ++i) { 33 | binom[i][0] = 1; 34 | for (int j = 1; j <= i; ++j) 35 | binom[i][j] = norm(binom[i - 1][j - 1] + binom[i - 1][j]); 36 | } 37 | sum[1] = 1; 38 | for (int i = 1; i <= k; ++i) { 39 | memset(tmp, 0, sizeof(tmp)); 40 | tmp[1] = 1; 41 | for (int j = 2; j <= n; ++j) 42 | for (int l = 1; l < j; ++l) 43 | tmp[j] = (tmp[j] + tmp[l] * (ll)sum[j - l] % M * binom[j - 2][l - 1]) % M; 44 | for (int j = 1; j <= n; ++j) 45 | sum[j] = norm(sum[j] + tmp[j]); 46 | } 47 | printf("%d\n", tmp[n]); 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /part2/agc025_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | typedef vector vi; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | ostream& operator<<(ostream& os, const pair& unit) { 39 | return os << unit.first << "^" << unit.second; 40 | } 41 | 42 | template 43 | ostream& operator<<(ostream& os, const vector& v) { 44 | if (!v.empty()) { 45 | os << v.front(); 46 | for (int i = 1; i < v.size(); ++i) 47 | os << ' ' << v[i]; 48 | } 49 | return os; 50 | } 51 | 52 | int main() { 53 | #ifdef LBT 54 | freopen("test.in", "r", stdin); 55 | int nol_cl = clock(); 56 | #endif 57 | ios::sync_with_stdio(false); 58 | cin.tie(nullptr); 59 | 60 | int n, d1, d2; 61 | cin >> n >> d1 >> d2; 62 | function(int)> calc = [&](int d) { 63 | vector ret(n * 2, vi(n * 2, -1)); 64 | vector> v; 65 | for (int i = 0; i * i <= d; ++i) { 66 | int j = sqrt(d - i * i); 67 | if (i * i + j * j != d) continue; 68 | v.emplace_back(i, j); 69 | v.emplace_back(-i, j); 70 | v.emplace_back(i, -j); 71 | v.emplace_back(-i, -j); 72 | } 73 | function dfs = [&](int x, int y) { 74 | for (const auto& pr : v) { 75 | int xi = x + pr.first, yi = y + pr.second; 76 | if (xi >= 0 && xi < n * 2 && yi >= 0 && yi < n * 2 && ret[xi][yi] == -1) { 77 | ret[xi][yi] = !ret[x][y]; 78 | dfs(xi, yi); 79 | } 80 | } 81 | }; 82 | for (int i = 0; i < n * 2; ++i) 83 | for (int j = 0; j < n * 2; ++j) 84 | if (ret[i][j] == -1) { 85 | ret[i][j] = 0; 86 | dfs(i, j); 87 | } 88 | return ret; 89 | }; 90 | vector r1 = calc(d1), r2 = calc(d2); 91 | vector res(n * 2, vi(n * 2)); 92 | vi cn(4); 93 | for (int i = 0; i < n * 2; ++i) 94 | for (int j = 0; j < n * 2; ++j) 95 | ++cn[res[i][j] = r1[i][j] | (r2[i][j] << 1)]; 96 | int v = max_element(cn.begin(), cn.end()) - cn.begin(); 97 | int cnt = 0; 98 | for (int i = 0; i < n * 2; ++i) { 99 | for (int j = 0; j < n * 2; ++j) 100 | if (res[i][j] == v) { 101 | cout << i << ' ' << j << '\n'; 102 | if (++cnt == n * n) break; 103 | } 104 | if (cnt == n * n) break; 105 | } 106 | 107 | #ifdef LBT 108 | LOG("Time: %dms\n", int ((clock() 109 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 110 | #endif 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /part2/agc026_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 110, P = 1000000007; 48 | 49 | int n; 50 | int h[N], stk[N], ch[N][2]; 51 | int dp[N][2]; 52 | 53 | int mpow(int x, int k) { 54 | int ret = 1; 55 | while (k) { 56 | if (k & 1) 57 | ret = ret * (ll)x % P; 58 | x = x * (ll)x % P; 59 | k >>= 1; 60 | } 61 | return ret; 62 | } 63 | 64 | void dfs(int x, int v) { 65 | dp[x][0] = 1; 66 | for (int k = 0; k < 2; ++k) 67 | if (ch[x][k]) { 68 | int c = ch[x][k]; 69 | dfs(c, h[x]); 70 | dp[x][1] = (dp[x][1] * (ll)(dp[c][0] + dp[c][1]) * 2 + dp[x][0] * ((ll)dp[c][0] + dp[c][1] * 2)) % P; 71 | dp[x][0] = dp[x][0] * (ll)dp[c][0] % P; 72 | } 73 | dp[x][0] = dp[x][0] * (ll)mpow(2, h[x] - v) % P; 74 | } 75 | 76 | int main() { 77 | ios::sync_with_stdio(false); 78 | cin.tie(nullptr); 79 | 80 | cin >> n; 81 | for (int i = 1; i <= n; ++i) 82 | cin >> h[i]; 83 | int cnt = 0; 84 | for (int i = 1; i <= n; ++i) { 85 | int cur = 0; 86 | while (cnt && h[stk[cnt]] > h[i]) { 87 | ch[stk[cnt]][1] = cur; 88 | cur = stk[cnt--]; 89 | } 90 | ch[i][0] = cur; 91 | stk[++cnt] = i; 92 | } 93 | int cur = 0; 94 | while (cnt > 1) { 95 | ch[stk[cnt]][1] = cur; 96 | cur = stk[cnt--]; 97 | } 98 | int rt = stk[1]; 99 | ch[rt][1] = cur; 100 | dfs(rt, 1); 101 | int ans = (dp[rt][0] + dp[rt][1]) % P * 2 % P; 102 | cout << ans << '\n'; 103 | 104 | return 0; 105 | } 106 | -------------------------------------------------------------------------------- /part2/agc026_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | typedef vector vi; 29 | 30 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 31 | 32 | template 33 | istream& operator>>(istream& is, vector& v) { 34 | for (T& x : v) 35 | is >> x; 36 | return is; 37 | } 38 | 39 | ostream& operator<<(ostream& os, const pair& unit) { 40 | return os << unit.first << "^" << unit.second; 41 | } 42 | 43 | template 44 | ostream& operator<<(ostream& os, const vector& v) { 45 | if (!v.empty()) { 46 | os << v.front(); 47 | for (int i = 1; i < v.size(); ++i) 48 | os << ' ' << v[i]; 49 | } 50 | return os; 51 | } 52 | 53 | string naive(string ba) { 54 | string ret = ba; 55 | while (!ba.empty()) { 56 | ba.erase(0, 1); 57 | ba.erase(ba.find_first_of('a'), 1); 58 | ret = max(ret, ba); 59 | } 60 | return ret; 61 | } 62 | 63 | int main() { 64 | #ifdef LBT 65 | freopen("test.in", "r", stdin); 66 | int nol_cl = clock(); 67 | #endif 68 | ios::sync_with_stdio(false); 69 | cin.tie(nullptr); 70 | 71 | int n; 72 | string s; 73 | cin >> n >> s; 74 | vector pre(n * 2); 75 | int cur = 0; 76 | for (int i = 0; i < n * 2; ++i) { 77 | if (s[i] == 'a') ++cur; 78 | else --cur; 79 | pre[i] = cur; 80 | } 81 | string ans; 82 | vector vs; 83 | int last = 0; 84 | for (int i = 0; i < n * 2; i += 2) { 85 | if (pre[i] < 0) { 86 | int r = find(pre.begin() + i, pre.end(), 0) - pre.begin(); 87 | last = r + 1; 88 | vs.push_back(naive(string(s.begin() + i, s.begin() + last))); 89 | i = r - 1; 90 | } 91 | } 92 | vector match(n * 2); 93 | queue q; 94 | for (int i = last; i < n * 2; ++i) 95 | if (s[i] == 'a') 96 | q.push(i); 97 | else { 98 | match[q.front()] = i; 99 | q.pop(); 100 | } 101 | for (int i = last; i < n * 2; ++i) { 102 | if (s[i] == 'b') continue; 103 | ans += "ab"; 104 | i = match[i]; 105 | } 106 | reverse(vs.begin(), vs.end()); 107 | for (const auto& str : vs) 108 | ans = max(ans, str + ans); 109 | cout << ans; 110 | 111 | #ifdef LBT 112 | LOG("Time: %dms\n", int ((clock() 113 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 114 | #endif 115 | return 0; 116 | } 117 | -------------------------------------------------------------------------------- /part2/agc027_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | ostream& operator<<(ostream& os, const pair& unit) { 39 | return os << unit.first << "^" << unit.second; 40 | } 41 | 42 | template 43 | ostream& operator<<(ostream& os, const vector& v) { 44 | if (!v.empty()) { 45 | os << v.front(); 46 | for (int i = 1; i < v.size(); ++i) 47 | os << ' ' << v[i]; 48 | } 49 | return os; 50 | } 51 | 52 | ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; } 53 | 54 | int main() { 55 | #ifdef LBT 56 | freopen("test.in", "r", stdin); 57 | int nol_cl = clock(); 58 | #endif 59 | ios::sync_with_stdio(false); 60 | cin.tie(nullptr); 61 | 62 | int n = 500; 63 | int val = n * n / 4; 64 | vector> ans(n + 2, vector(n + 2, 1)); 65 | int cnt = 0, l = 3, r = val * 2 + 1; 66 | set st; 67 | for (int i = 3; i <= n * 2; i += 2) 68 | for (int x = max(1, i - n), y = i - x; x + 1 <= n && y - 1 > 0; x += 2, y -= 2) { 69 | if (++cnt & 1) { 70 | ans[x][y] = l; 71 | ans[x + 1][y - 1] = l * 2; 72 | st.insert(l); st.insert(l * 2); 73 | l += 2; 74 | } else { 75 | ans[x][y] = r; 76 | ans[x + 1][y - 1] = r * 2; 77 | st.insert(r); st.insert(r * 2); 78 | r -= 2; 79 | } 80 | } 81 | for (int i = 1; i <= n; ++i) 82 | for (int j = 1; j <= n; ++j) { 83 | if (ans[i][j] == 1) { 84 | ll l = lcm(lcm(ans[i - 1][j], ans[i + 1][j]), lcm(ans[i][j - 1], ans[i][j + 1])); 85 | ll v = 1; 86 | while (st.count(v * l + 1)) ++v; 87 | ans[i][j] += l * v; 88 | st.insert(ans[i][j]); 89 | } 90 | } 91 | cin >> n; 92 | for (int i = 1; i <= n; ++i) 93 | cout << vector(ans[i].begin() + 1, ans[i].begin() + n + 1) << '\n'; 94 | 95 | #ifdef LBT 96 | LOG("Time: %dms\n", int ((clock() 97 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 98 | #endif 99 | return 0; 100 | } 101 | -------------------------------------------------------------------------------- /part2/agc028_c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | typedef long long ll; 9 | 10 | const int N = 100010; 11 | 12 | int n; 13 | int a[N], b[N]; 14 | int arr[N * 2]; 15 | ll sum[N * 2]; 16 | 17 | int main() { 18 | scanf("%d", &n); 19 | for (int i = 1; i <= n; ++i) 20 | scanf("%d%d", &a[i], &b[i]); 21 | ll ans = min(accumulate(a + 1, a + n + 1, 0LL), accumulate(b + 1, b + n + 1, 0LL)); 22 | copy(a + 1, a + n + 1, arr + 1); 23 | copy(b + 1, b + n + 1, arr + n + 1); 24 | sort(arr + 1, arr + n * 2 + 1); 25 | for (int i = 1; i <= n * 2; ++i) 26 | sum[i] = sum[i - 1] + arr[i]; 27 | for (int i = 1; i <= n; ++i) { 28 | int x = lower_bound(arr + 1, arr + n * 2 + 1, a[i]) - arr, 29 | y = lower_bound(arr + 1, arr + n * 2 + 1, b[i]) - arr; 30 | if (x == y) 31 | ++y; 32 | for (int j = n; j >= n - 2; --j) 33 | if ((j + (x > j) + (y > j)) == n) 34 | ans = min(ans, sum[j] + (x > j) * arr[x] + (y > j) * arr[y]); 35 | } 36 | printf("%lld\n", ans); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /part2/agc028_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | 9 | const int N = 310, P = 1000000007; 10 | 11 | int n; 12 | 13 | int match[N * 2], pre[N], sum[N * 2]; 14 | bool ab[N * 2][N * 2]; 15 | int con[N * 2][N * 2], spec[N * 2][N * 2]; 16 | 17 | int main() { 18 | int k; 19 | scanf("%d%d", &n, &k); 20 | while (k--) { 21 | int a, b; 22 | scanf("%d%d", &a, &b); 23 | match[a] = b; 24 | match[b] = a; 25 | } 26 | pre[0] = 1; 27 | for (int i = 1; i <= n; ++i) 28 | pre[i] = pre[i - 1] * (ll)(i * 2 - 1) % P; 29 | for (int l = 1; l <= n * 2; ++l) { 30 | int myn = n * 2, mex = 1; 31 | for (int r = l; r <= n * 2; ++r) { 32 | if (match[r]) { 33 | myn = min(myn, match[r]); 34 | mex = max(mex, match[r]); 35 | } 36 | ab[l][r] = myn >= l && mex <= r; 37 | } 38 | } 39 | for (int i = 1; i <= n * 2; ++i) 40 | sum[i] = sum[i - 1] + bool(match[i]); 41 | int ans = 0; 42 | for (int len = 2; len <= n * 2; len += 2) 43 | for (int l = 1; l + len - 1 <= n * 2; ++l) { 44 | int r = l + len - 1; 45 | if (!ab[l][r]) 46 | continue; 47 | con[l][r] = pre[(len - sum[r] + sum[l - 1]) >> 1]; 48 | spec[l][r] = con[l][r]; 49 | for (int i = l + 1; i < r; i += 2) 50 | spec[l][r] = (P + spec[l][r] - spec[l][i] * (ll)con[i + 1][r] % P) % P; 51 | ans = (ans + spec[l][r] * (ll)pre[(n * 2 - len - sum[l - 1] - sum[n * 2] + sum[r]) >> 1]) % P; 52 | } 53 | printf("%d\n", ans); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /part2/agc029_c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #define LOG(FMT...) fprintf(stderr, FMT) 18 | 19 | using namespace std; 20 | 21 | typedef long long ll; 22 | typedef unsigned long long ull; 23 | 24 | const int N = 200010; 25 | 26 | int n; 27 | int a[N]; 28 | 29 | bool pred(int x) { 30 | map cur; 31 | for (int i = 2; i <= n; ++i) { 32 | if (a[i] > a[i - 1]) 33 | continue; 34 | int pos = a[i] - 1; 35 | cur.erase(cur.lower_bound(a[i]), cur.end()); 36 | while (pos && cur[pos] == x - 1) 37 | cur.erase(pos--); 38 | if (cur[pos] == x - 1) 39 | return false; 40 | ++cur[pos]; 41 | } 42 | return true; 43 | } 44 | 45 | int main() { 46 | #ifdef LBT 47 | freopen("test.in", "r", stdin); 48 | int nol_cl = clock(); 49 | #endif 50 | 51 | scanf("%d", &n); 52 | for (int i = 1; i <= n; ++i) 53 | scanf("%d", &a[i]); 54 | bool flag = true; 55 | for (int i = 2; i <= n; ++i) 56 | flag &= a[i] > a[i - 1]; 57 | if (flag) { 58 | puts("1"); 59 | return 0; 60 | } 61 | int l = 2, r = n; 62 | while (l < r) { 63 | int mid = (l + r) >> 1; 64 | if (pred(mid)) 65 | r = mid; 66 | else 67 | l = mid + 1; 68 | } 69 | printf("%d\n", l); 70 | 71 | #ifdef LBT 72 | LOG("Time: %dms\n", int((clock() - nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 73 | #endif 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /part2/agc029_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LOG(FMT...) fprintf(stderr, FMT) 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | typedef unsigned long long ull; 9 | typedef vector vi; 10 | 11 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 12 | 13 | template 14 | istream &operator>>(istream &is, vector &v) { 15 | for (T &x : v) 16 | is >> x; 17 | return is; 18 | } 19 | 20 | ostream &operator<<(ostream &os, const pair &unit) { 21 | return os << unit.first << "^" << unit.second; 22 | } 23 | 24 | template 25 | ostream &operator<<(ostream &os, const vector &v) { 26 | if (!v.empty()) { 27 | os << v.front(); 28 | for (int i = 1; i < v.size(); ++i) 29 | os << ' ' << v[i]; 30 | } 31 | return os; 32 | } 33 | 34 | const int N = 200010; 35 | 36 | int n; 37 | vector g[N]; 38 | int prt[N], mx[N], ans[N]; 39 | bool vis[N]; 40 | 41 | void dfs(int u) { 42 | vis[u] = true; 43 | for (int v : g[u]) 44 | if (!vis[v]) { 45 | prt[v] = u; 46 | mx[v] = max(mx[u], u); 47 | dfs(v); 48 | } 49 | } 50 | 51 | int f(int u, int x) { 52 | static unordered_map memo; 53 | auto it = memo.find(u * (ll)n + x); 54 | if (it == memo.end()) { 55 | int ret = 1; 56 | for (int v : g[u]) 57 | if (prt[v] == u && v < x) 58 | ret += f(v, x); 59 | it = memo.insert(make_pair(u * (ll)n + x, ret)).first; 60 | } 61 | return it->second; 62 | } 63 | 64 | void dfs2(int u) { 65 | if (u != 1) { 66 | if (u > mx[prt[u]]) 67 | ans[u] = ans[prt[u]] + f(u, mx[u]); 68 | else 69 | ans[u] = ans[prt[u]] + f(u, mx[u]) - f(u, mx[prt[u]]); 70 | } 71 | for (int v : g[u]) 72 | if (prt[v] == u) 73 | dfs2(v); 74 | } 75 | 76 | int main() { 77 | #ifdef LBT 78 | freopen("test.in", "r", stdin); 79 | int nol_cl = clock(); 80 | #endif 81 | ios::sync_with_stdio(false); 82 | cin.tie(nullptr); 83 | 84 | cin >> n; 85 | for (int rep = 1; rep < n; ++rep) { 86 | int u, v; 87 | cin >> u >> v; 88 | g[u].push_back(v); 89 | g[v].push_back(u); 90 | } 91 | dfs(1); 92 | dfs2(1); 93 | cout << vi(ans + 2, ans + n + 1); 94 | 95 | #ifdef LBT 96 | LOG("Time: %dms\n", int ((clock() 97 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 98 | #endif 99 | return 0; 100 | } 101 | -------------------------------------------------------------------------------- /part2/agc030_c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | int main() { 49 | ios::sync_with_stdio(false); 50 | cin.tie(nullptr); 51 | 52 | int k; 53 | cin >> k; 54 | if (k == 1) 55 | cout << "1\n1"; 56 | else { 57 | int n = (k + 3) / 4 * 2; 58 | vector> ans(n, vector(n)); 59 | for (int i = 0; i < n; ++i) 60 | for (int j = 0; j < n; ++j) { 61 | ans[i][j] = 1 + ((i & 1) ? (n + (i + j) % n) : ((i + j) % n)); 62 | while (ans[i][j] > k) ans[i][j] -= n; 63 | } 64 | cout << n << '\n'; 65 | for (int i = 0; i < n; ++i) 66 | cout << ans[i] << '\n'; 67 | } 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /part2/agc030_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 3010, P = 1000000007; 48 | 49 | int a[N]; 50 | int p[N][N][2]; 51 | 52 | int main() { 53 | #ifdef LBT 54 | freopen("test.in", "r", stdin); 55 | int nol_cl = clock(); 56 | #endif 57 | ios::sync_with_stdio(false); 58 | cin.tie(nullptr); 59 | 60 | int n, q; 61 | cin >> n >> q; 62 | for (int i = 1; i <= n; ++i) 63 | cin >> a[i]; 64 | for (int i = 1; i < n; ++i) 65 | for (int j = i + 1; j <= n; ++j) 66 | if (a[i] > a[j]) 67 | p[i][j][1] = 1; 68 | else if (a[i] < a[j]) 69 | p[i][j][0] = 1; 70 | int pr = (P + 1) >> 1; 71 | int rep = q; 72 | while (rep--) { 73 | int x, y; 74 | cin >> x >> y; 75 | if (x > y) swap(x, y); 76 | for (int i = 1; i <= n; ++i) 77 | if (i < x) { 78 | for (int j = 0; j < 2; ++j) { 79 | int a = (p[i][x][j] + p[i][y][j]) * (ll)pr % P; 80 | p[i][x][j] = p[i][y][j] = a; 81 | } 82 | } else if (x < i && i < y) { 83 | for (int j = 0; j < 2; ++j) { 84 | int a = (p[x][i][j] + p[i][y][!j]) * (ll)pr % P; 85 | p[x][i][j] = p[i][y][!j] = a; 86 | } 87 | } else if (y < i) { 88 | for (int j = 0; j < 2; ++j) { 89 | int a = (p[x][i][j] + p[y][i][j]) * (ll)pr % P; 90 | p[x][i][j] = p[y][i][j] = a; 91 | } 92 | } 93 | int a = (p[x][y][0] + p[x][y][1]) * (ll)pr % P; 94 | p[x][y][0] = p[x][y][1] = a; 95 | } 96 | int ans = 0; 97 | for (int i = 1; i < n; ++i) 98 | for (int j = i + 1; j <= n; ++j) 99 | ans = (ans + p[i][j][1]) % P; 100 | while (q--) 101 | ans = ans * 2 % P; 102 | cout << ans << '\n'; 103 | 104 | #ifdef LBT 105 | LOG("Time: %dms\n", int ((clock() 106 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 107 | #endif 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /part2/agc030_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int P = 1000000007; 48 | 49 | void add(int& x, int y) { 50 | if ((x += y) >= P) 51 | x -= P; 52 | } 53 | 54 | void sub(int& x, int y) { 55 | if ((x -= y) < 0) 56 | x += P; 57 | } 58 | 59 | int norm(int x) { return x >= P ? x - P : x; } 60 | 61 | int main() { 62 | #ifdef LBT 63 | freopen("test.in", "r", stdin); 64 | int nol_cl = clock(); 65 | #endif 66 | ios::sync_with_stdio(false); 67 | cin.tie(nullptr); 68 | 69 | int n; 70 | cin >> n; 71 | vector a(n * 2), pos(n * 2, -1); 72 | cin >> a; 73 | for (int i = 0; i < n * 2; ++i) 74 | if (a[i] != -1) 75 | pos[--a[i]] = i; 76 | int empties = 0; 77 | for (int i = 0; i < n; ++i) 78 | if (a[i * 2] == -1 && a[i * 2 + 1] == -1) 79 | ++empties; 80 | vector> dp(n + 1, vector(n + 1)); 81 | dp[0][0] = 1; 82 | for (int i = 0; i < n * 2; ++i) { 83 | if (pos[i] != -1 && a[pos[i] ^ 1] != -1) 84 | continue; 85 | vector> newDp(n + 1, vector(n + 1)); 86 | if (pos[i] == -1) { 87 | for (int j = 0; j <= n; ++j) 88 | for (int k = 0; k <= n; ++k) { 89 | if (k < n) 90 | add(newDp[j][k + 1], dp[j][k]); 91 | if (j < n) 92 | add(newDp[j + 1][k], dp[j][k]); 93 | if (k) 94 | add(newDp[j][k - 1], dp[j][k]); 95 | } 96 | } else { 97 | for (int j = 0; j <= n; ++j) 98 | for (int k = 0; k <= n; ++k) { 99 | if (k < n) 100 | add(newDp[j][k + 1], dp[j][k]); 101 | if (j) 102 | add(newDp[j - 1][k], dp[j][k] * (ll)j % P); 103 | } 104 | } 105 | dp = newDp; 106 | } 107 | int ans = dp[0][0]; 108 | for (int i = 1; i <= empties; ++i) 109 | ans = ans * (ll)i % P; 110 | cout << ans << '\n'; 111 | 112 | #ifdef LBT 113 | LOG("Time: %dms\n", int ((clock() 114 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 115 | #endif 116 | return 0; 117 | } 118 | -------------------------------------------------------------------------------- /part2/agc031_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | ostream& operator<<(ostream& os, const pair& unit) { 38 | return os << unit.first << "^" << unit.second; 39 | } 40 | 41 | template 42 | ostream& operator<<(ostream& os, const vector& v) { 43 | if (!v.empty()) { 44 | os << v.front(); 45 | for (int i = 1; i < v.size(); ++i) 46 | os << ' ' << v[i]; 47 | } 48 | return os; 49 | } 50 | 51 | typedef vector vi; 52 | 53 | int norm(int x, int m) { 54 | x %= m; 55 | if (x < 0) x += m; 56 | return x; 57 | } 58 | 59 | vi power(const vi& p, int k) { 60 | int n = p.size(); 61 | vector vis(n); 62 | vi ret(n); 63 | for (int i = 0; i < n; ++i) 64 | if (!vis[i]) { 65 | vector cycle; 66 | int x = i; 67 | while (!vis[x]) { 68 | cycle.push_back(x); 69 | vis[x] = true; 70 | x = p[x]; 71 | } 72 | for (int i = 0; i < cycle.size(); ++i) 73 | ret[cycle[i]] = cycle[norm(i + k, cycle.size())]; 74 | } 75 | return ret; 76 | } 77 | 78 | vi inverse(const vi& p) { return power(p, -1); } 79 | 80 | vi mult(const vi& p, const vi& q) { 81 | int n = p.size(); 82 | vi ret(n); 83 | for (int i = 0; i < n; ++i) 84 | ret[i] = p[q[i]]; 85 | return ret; 86 | } 87 | 88 | template 89 | vi mult(const T& first, const Args&... args...) { 90 | return mult(first, mult(args...)); 91 | } 92 | 93 | int main() { 94 | #ifdef LBT 95 | freopen("test.in", "r", stdin); 96 | int nol_cl = clock(); 97 | #endif 98 | ios::sync_with_stdio(false); 99 | cin.tie(nullptr); 100 | 101 | int n, k; 102 | cin >> n >> k; 103 | --k; 104 | vi p(n), q(n); 105 | cin >> p >> q; 106 | for (int& v : p) --v; 107 | for (int& v : q) --v; 108 | vi ip = inverse(p), iq = inverse(q), w = mult(q, ip, iq, p); 109 | int m = k / 6; 110 | static vi little[6]; 111 | little[0] = mult(power(w, m), q, p, iq, power(w, 1 - m)); 112 | little[1] = mult(power(w, m), q, power(w, -m)); 113 | int r = k % 6; 114 | for (int i = 2; i <= r; ++i) 115 | little[i] = mult(little[i - 1], inverse(little[i - 2])); 116 | vi ans = little[r]; 117 | for (int& v : ans) ++v; 118 | cout << ans << '\n'; 119 | 120 | #ifdef LBT 121 | LOG("Time: %dms\n", int ((clock() 122 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 123 | #endif 124 | return 0; 125 | } 126 | -------------------------------------------------------------------------------- /part2/agc032_c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | int main() { 49 | ios::sync_with_stdio(false); 50 | cin.tie(nullptr); 51 | 52 | int n, m; 53 | cin >> n >> m; 54 | vector deg(n); 55 | vector> g(n); 56 | for (int rep = 0; rep < m; ++rep) { 57 | int u, v; 58 | cin >> u >> v; 59 | ++deg[u - 1]; ++deg[v - 1]; 60 | g[u - 1].push_back(v - 1); 61 | g[v - 1].push_back(u - 1); 62 | } 63 | if (m <= n + 1) { 64 | puts("No"); 65 | return 0; 66 | } 67 | for (int i = 0; i < n; ++i) 68 | if (deg[i] % 2) { 69 | puts("No"); 70 | return 0; 71 | } 72 | if (m == n + 2 && count(deg.begin(), deg.end(), 4) == 2) { 73 | int u = find(deg.begin(), deg.end(), 4) - deg.begin(); 74 | queue> q; 75 | for (const auto& v : g[u]) 76 | q.emplace(u, v); 77 | while (!q.empty()) { 78 | int x = q.front().first, y = q.front().second; 79 | q.pop(); 80 | if (deg[y] == 4 && y == u) { 81 | puts("Yes"); 82 | return 0; 83 | } 84 | if (deg[y] == 4) continue; 85 | for (const auto& v : g[y]) 86 | if (v != x) 87 | q.emplace(y, v); 88 | } 89 | puts("No"); 90 | } else 91 | puts("Yes"); 92 | 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /part2/agc032_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 5010; 49 | const ll INF = 1LL << 60; 50 | 51 | int n, a, b; 52 | int p[N]; 53 | ll dp[N][N]; 54 | 55 | int main() { 56 | ios::sync_with_stdio(false); 57 | cin.tie(nullptr); 58 | 59 | cin >> n >> a >> b; 60 | for (int i = 1; i <= n; ++i) 61 | cin >> p[i]; 62 | for (int i = 1; i <= n; ++i) { 63 | fill(dp[i], dp[i] + n + 1, INF); 64 | for (int j = 0; j <= n; ++j) { 65 | if (p[i] <= j) 66 | dp[i][j] = min(dp[i - 1][p[i] - 1], dp[i - 1][j] + b); 67 | else 68 | dp[i][j] = dp[i - 1][j] + a; 69 | if (j) 70 | dp[i][j] = min(dp[i][j], dp[i][j - 1]); 71 | } 72 | } 73 | cout << dp[n][n] << '\n'; 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /part2/agc032_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | typedef vector vi; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | ostream& operator<<(ostream& os, const pair& unit) { 39 | return os << unit.first << "^" << unit.second; 40 | } 41 | 42 | template 43 | ostream& operator<<(ostream& os, const vector& v) { 44 | if (!v.empty()) { 45 | os << v.front(); 46 | for (int i = 1; i < v.size(); ++i) 47 | os << ' ' << v[i]; 48 | } 49 | return os; 50 | } 51 | 52 | int main() { 53 | #ifdef LBT 54 | freopen("test.in", "r", stdin); 55 | int nol_cl = clock(); 56 | #endif 57 | ios::sync_with_stdio(false); 58 | cin.tie(nullptr); 59 | 60 | int n, m; 61 | cin >> n >> m; 62 | vector a(n * 2); 63 | cin >> a; 64 | sort(a.begin(), a.end()); 65 | int l = 0, r = n; 66 | function pred = [&](int x) { 67 | for (int i = 1; i <= x; ++i) 68 | if (a[n * 2 - i] + a[n * 2 - x * 2 + i - 1] < m) 69 | return false; 70 | return true; 71 | }; 72 | while (l < r) { 73 | int mid = (l + r + 1) >> 1; 74 | if (pred(mid)) 75 | l = mid; 76 | else 77 | r = mid - 1; 78 | } 79 | int ans = 0; 80 | int x = l; 81 | for (int i = 1; i <= x; ++i) 82 | ans = max(ans, a[n * 2 - i] + a[n * 2 - x * 2 + i - 1] - m); 83 | for (int i = 0; i < n - x; ++i) 84 | ans = max(ans, (a[i] + a[(n - x) * 2 - i - 1]) % m); 85 | cout << ans; 86 | 87 | #ifdef LBT 88 | LOG("Time: %dms\n", int ((clock() 89 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 90 | #endif 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /part2/agc033_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | const int N = 190; 31 | 32 | int n, m; 33 | char s[N][N]; 34 | int sum[N][N]; 35 | int dp[N][N][N], tmp[N][N][N]; 36 | 37 | int main() { 38 | #ifdef LBT 39 | freopen("test.in", "r", stdin); 40 | int nol_cl = clock(); 41 | #endif 42 | 43 | scanf("%d%d", &n, &m); 44 | for (int i = 1; i <= n; ++i) 45 | scanf("%s", s[i] + 1); 46 | for (int i = 1; i <= n; ++i) 47 | for (int j = 1; j <= m; ++j) 48 | sum[i][j] = (s[i][j] == '#') + sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1]; 49 | for (int i = 1; i <= n; ++i) 50 | for (int j = i; j <= n; ++j) { 51 | int l = 0; 52 | for (int k = 1; k <= m; ++k) { 53 | ++l; 54 | while (true) { 55 | int expect = (j - i + 1) * l, actual = sum[j][k] - sum[j][k - l] - sum[i - 1][k] + sum[i - 1][k - l]; 56 | if (actual == 0 || actual == expect) 57 | break; 58 | --l; 59 | } 60 | dp[i][j][k] = l; 61 | } 62 | } 63 | int ans = 0; 64 | while (dp[1][n][m] != m) { 65 | ++ans; 66 | memset(tmp, 0, sizeof(tmp)); 67 | for (int i = 1; i <= n; ++i) { 68 | for (int k = 1; k <= m; ++k) { 69 | int ptr = i; 70 | for (int j = i + 1; j <= n; ++j) { 71 | while (ptr < j - 1 && dp[i][ptr + 1][k] > dp[ptr + 2][j][k]) 72 | ++ptr; 73 | tmp[i][j][k] = max(min(dp[i][ptr][k], dp[ptr + 1][j][k]), min(dp[i][ptr + 1][k], dp[ptr + 2][j][k])); 74 | } 75 | } 76 | } 77 | for (int i = 1; i <= n; ++i) 78 | for (int j = i; j <= n; ++j) 79 | for (int k = m; k; --k) 80 | dp[i][j][k] = max(tmp[i][j][k], dp[i][j][k] + dp[i][j][k - dp[i][j][k]]); 81 | } 82 | printf("%d\n", ans); 83 | 84 | #ifdef LBT 85 | LOG("Time: %dms\n", int ((clock() 86 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 87 | #endif 88 | return 0; 89 | } 90 | -------------------------------------------------------------------------------- /part2/agc033_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 200010, P = 1000000007; 49 | 50 | int n, m; 51 | char s[N]; 52 | 53 | void add(int& x, int y) { 54 | if ((x += y) >= P) 55 | x -= P; 56 | } 57 | 58 | void sub(int& x, int y) { 59 | if ((x -= y) < 0) 60 | x += P; 61 | } 62 | 63 | int norm(int x) { 64 | return x >= P ? x - P : x; 65 | } 66 | 67 | int main() { 68 | ios::sync_with_stdio(false); 69 | cin.tie(nullptr); 70 | 71 | cin >> n >> m >> (s + 1); 72 | char a = s[1]; 73 | if (count(s + 1, s + m + 1, a) == m) { 74 | static int dp[N][2][2]; 75 | dp[1][0][0] = dp[1][1][1] = 1; 76 | for (int i = 2; i <= n; ++i) 77 | for (int j = 0; j < 2; ++j) { 78 | add(dp[i][j][0], dp[i - 1][j][0]); 79 | add(dp[i][j][0], dp[i - 1][j][1]); 80 | add(dp[i][j][1], dp[i - 1][j][0]); 81 | } 82 | int ans = norm(norm(dp[n][0][0] + dp[n][0][1]) + dp[n][1][0]); 83 | cout << ans << '\n'; 84 | return 0; 85 | } 86 | int p = 1; 87 | while (s[p] == a) ++p; 88 | int len = p - 1; 89 | if (len % 2 == 0) ++len; 90 | int cur = 0; 91 | for (; p <= m; ++p) 92 | if (s[p] != a) { 93 | if (cur & 1) 94 | len = min(len, cur); 95 | cur = 0; 96 | } else 97 | ++cur; 98 | static int dp[N], sum[N]; 99 | dp[1] = 1; 100 | for (int i = 2; i <= n; ++i) { 101 | sum[i - 1] = dp[i - 1]; 102 | if (i - 3 >= 0) 103 | add(sum[i - 1], sum[i - 3]); 104 | dp[i] = sum[i - 2]; 105 | if (i - len - 3 >= 0) 106 | sub(dp[i], sum[i - len - 3]); 107 | } 108 | int ans = 0; 109 | for (int i = 1; i <= n; ++i) 110 | if ((n - i) <= len && ((n - i) & 1)) 111 | ans = (ans + dp[i] * (n - i + 1LL)) % P; 112 | cout << ans << '\n'; 113 | 114 | return 0; 115 | } 116 | -------------------------------------------------------------------------------- /part2/agc034_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 2010; 48 | 49 | int n; 50 | char s[N]; 51 | bool vis[N]; 52 | int sub[N]; 53 | vector g[N]; 54 | 55 | int iabs(int x) { return x < 0 ? -x : x; } 56 | 57 | pair dfs(int u) { 58 | vis[u] = true; 59 | pair ret(0, 0); 60 | sub[u] = s[u] == '1'; 61 | for (int v : g[u]) 62 | if (!vis[v]) { 63 | auto cur = dfs(v); 64 | sub[u] += sub[v]; 65 | cur.first += sub[v]; 66 | cur.second += sub[v]; 67 | if (max(cur.first, ret.first) <= min(cur.second, ret.second)) 68 | ret = make_pair((cur.first ^ ret.first) & 1, cur.second + ret.second); 69 | else 70 | ret = make_pair(iabs(cur.first - ret.first), cur.second + ret.second); 71 | } 72 | return ret; 73 | } 74 | 75 | int main() { 76 | #ifdef LBT 77 | freopen("test.in", "r", stdin); 78 | int nol_cl = clock(); 79 | #endif 80 | ios::sync_with_stdio(false); 81 | cin.tie(nullptr); 82 | 83 | cin >> n >> (s + 1); 84 | for (int rep = 1; rep < n; ++rep) { 85 | int u, v; 86 | cin >> u >> v; 87 | g[u].push_back(v); 88 | g[v].push_back(u); 89 | } 90 | int ans = -1; 91 | for (int u = 1; u <= n; ++u) { 92 | memset(sub, 0, sizeof(sub)); 93 | memset(vis, 0, sizeof(vis)); 94 | auto res = dfs(u); 95 | if (res.first == 0) 96 | if (ans == -1 || ans > res.second / 2) 97 | ans = res.second / 2; 98 | } 99 | cout << ans << '\n'; 100 | 101 | #ifdef LBT 102 | LOG("Time: %dms\n", int ((clock() 103 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 104 | #endif 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /part2/agc035_c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | int main() { 31 | int n; 32 | scanf("%d", &n); 33 | if (!(n & (n - 1))) { 34 | puts("No"); 35 | return 0; 36 | } 37 | puts("Yes"); 38 | int m = n; 39 | printf("%d %d\n", 1 + n, 3); 40 | if (n % 2 == 0) --m; 41 | for (int i = 2; i < m; i += 2) { 42 | printf("%d %d\n", i, i + 1); 43 | printf("%d %d\n", i, 1); 44 | printf("%d %d\n", i + n, i + 1 + n); 45 | printf("%d %d\n", i + n + 1, 1); 46 | } 47 | if (n % 2 == 0) { 48 | int x = n & -n; 49 | int y = n - x; 50 | printf("%d %d\n", x, n); 51 | printf("%d %d\n", y + n + 1, n * 2); 52 | } 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /part2/agc035_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 20; 49 | 50 | int n; 51 | int a[N]; 52 | map, ll> dp[N][N]; 53 | 54 | ll dfs(int l, int r, int x, int y) { 55 | if (l + 1 == r) return 0; 56 | auto it = dp[l][r].find(make_pair(x, y)); 57 | if (it != dp[l][r].end()) 58 | return it->second; 59 | ll cur = 1LL << 60; 60 | for (int i = l + 1; i < r; ++i) 61 | cur = min(cur, dfs(l, i, x, x + y) + dfs(i, r, x + y, y) + a[i] * (ll)(x + y)); 62 | return dp[l][r][make_pair(x, y)] = cur; 63 | } 64 | 65 | int main() { 66 | ios::sync_with_stdio(false); 67 | cin.tie(nullptr); 68 | 69 | cin >> n; 70 | for (int i = 1; i <= n; ++i) 71 | cin >> a[i]; 72 | cout << (dfs(1, n, 1, 1) + a[1] + a[n]) << '\n'; 73 | 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /part2/agc036_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define LOG(FMT...) fprintf(stderr, FMT) 12 | 13 | using namespace std; 14 | 15 | typedef long long ll; 16 | 17 | const int N = 510; 18 | 19 | int n; 20 | ll a[N][N], dp[N][N]; 21 | 22 | int main() { 23 | #ifdef LBT 24 | freopen("test.in", "r", stdin); 25 | #endif 26 | 27 | scanf("%d", &n); 28 | for (int i = 1; i <= n; ++i) 29 | for (int j = 1; j <= n; ++j) 30 | if (i != j) 31 | scanf("%lld", &a[i][j]); 32 | for (int i = 1; i <= n; ++i) 33 | for (int j = i + 1; j <= n; ++j) 34 | a[i][j] += a[i][j - 1]; 35 | for (int j = 1; j <= n; ++j) 36 | for (int i = j + 1; i <= n; ++i) 37 | a[i][j] += a[i - 1][j]; 38 | for (int i = 1; i <= n; ++i) { 39 | ll as = 0; 40 | for (int j = i; j; --j) { 41 | dp[i][j] = 1LL << 60; 42 | as += a[j][i]; 43 | ll bs = 0; 44 | for (int k = j != 1; k < j; ++k) { 45 | dp[i][j] = min(dp[i][j], dp[j - 1][k] + bs); 46 | bs += a[i][k] - a[j - 1][k]; 47 | } 48 | dp[i][j] += as; 49 | } 50 | } 51 | ll ans = *min_element(dp[n] + 1, dp[n] + n + 1); 52 | printf("%lld\n", ans); 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /part2/agc036_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | int M; 48 | 49 | void add(int& x, int y) { 50 | if ((x += y) >= M) 51 | x -= M; 52 | } 53 | 54 | void sub(int& x, int y) { 55 | if ((x -= y) < 0) 56 | x += M; 57 | } 58 | 59 | int main() { 60 | #ifdef LBT 61 | freopen("test.in", "r", stdin); 62 | int nol_cl = clock(); 63 | #endif 64 | ios::sync_with_stdio(false); 65 | cin.tie(nullptr); 66 | 67 | int n; 68 | cin >> n >> M; 69 | 70 | vector low(n), up(n * 2); 71 | for (int i = 0; i < n * 2; ++i) 72 | up[i] = sqrt(n * n * 4 - i * i); 73 | for (int i = 0; i < n; ++i) 74 | low[i] = ceil(sqrt(n * n - i * i)) - 1; 75 | up[0] = n * 2 - 1; 76 | int ans = 0; 77 | 78 | vector> pre(n, vector(n)); 79 | vector pt(n); 80 | int ptr = n * 2 - 1; 81 | for (int i = n - 1; i >= 0; --i) { 82 | int qtr = ptr; 83 | while (qtr >= n && up[qtr] <= low[i]) --qtr; 84 | for (int j = 0; j < n - i; ++j) { 85 | int res = 1; 86 | for (int k = ptr; k > qtr; --k) 87 | res = res * (up[k] + 1LL - (n * 2 - k - 1 + j)) % M; 88 | pre[i][j] = res; 89 | } 90 | ptr = qtr; 91 | pt[i] = n * 2 - ptr - 1; 92 | } 93 | for (int i = 0; i <= n; ++i) { 94 | vector dp(i + 1); 95 | dp[0] = 1; 96 | for (int j = n - 1; j >= 0; --j) { 97 | for (int k = 0; k <= i; ++k) 98 | dp[k] = dp[k] * (ll)pre[j][k] % M; 99 | for (int k = i; k >= 0; --k) { 100 | dp[k] = dp[k] * (up[j] + 1LL - (n * 2 - j - 1 + i - k)) % M; 101 | if (k) 102 | add(dp[k], dp[k - 1] * (low[j] + 1LL - (pt[j] + (k - 1))) % M); 103 | } 104 | } 105 | int res = dp[i]; 106 | for (int j = n; j <= ptr; ++j) 107 | res = res * (up[j] + 1LL - (n * 2 - j - 1 + i)) % M; 108 | if (i & 1) 109 | sub(ans, res); 110 | else 111 | add(ans, res); 112 | } 113 | cout << ans << '\n'; 114 | 115 | #ifdef LBT 116 | LOG("Time: %dms\n", int ((clock() 117 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 118 | #endif 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /part2/agc037_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 5010; 48 | 49 | char s[N * 2], ans[N], tmp[N]; 50 | int cur[N * 2]; 51 | 52 | int main() { 53 | #ifdef LBT 54 | freopen("test.in", "r", stdin); 55 | int nol_cl = clock(); 56 | #endif 57 | ios::sync_with_stdio(false); 58 | cin.tie(nullptr); 59 | 60 | int n, k; 61 | cin >> n >> k >> (s + 1); 62 | for (int i = 1; i <= n; ++i) 63 | s[i + n] = s[n - i + 1]; 64 | char c = *min_element(s + 1, s + n + 1); 65 | int len = 0; 66 | for (int i = 1; i <= n * 2; ++i) 67 | if (s[i] == c) 68 | len = max(len, cur[i] = cur[i - 1] + 1); 69 | if (k >= 15 || (len << (k - 1)) >= n) { 70 | for (int rep = 0; rep < n; ++rep) 71 | putchar(c); 72 | putchar('\n'); 73 | return 0; 74 | } 75 | for (int i = n + 1; i <= n * 2; ++i) 76 | if (cur[i] == len) { 77 | for (int j = 1; j <= (n - (len << (k - 1))); ++j) 78 | tmp[j] = s[i - len - j + 1]; 79 | if (ans[1] == 0 || strcmp(ans + 1, tmp + 1) > 0) 80 | memcpy(ans + 1, tmp + 1, n - (len << (k - 1))); 81 | } 82 | for (int rep = 0; rep < len << (k - 1); ++rep) 83 | putchar(c); 84 | puts(ans + 1); 85 | 86 | #ifdef LBT 87 | LOG("Time: %dms\n", int ((clock() 88 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 89 | #endif 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /part2/agc039_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | typedef complex C; 49 | 50 | const double PI = acos(-1.); 51 | 52 | int main() { 53 | #ifdef LBT 54 | freopen("test.in", "r", stdin); 55 | int nol_cl = clock(); 56 | #endif 57 | ios::sync_with_stdio(false); 58 | cin.tie(nullptr); 59 | 60 | int n, l; 61 | cin >> n >> l; 62 | vector t(n); 63 | cin >> t; 64 | vector theta(n); 65 | transform(t.begin(), t.end(), theta.begin(), [&](int t) { return 2 * PI * t / l; }); 66 | function unit = [](double theta) { 67 | return C(cos(theta), sin(theta)); 68 | }; 69 | C ans = 0; 70 | C sum = 0; 71 | for (int i = 1; i < n - 1; ++i) { 72 | sum += unit(theta[i - 1] * .5); 73 | for (int j = i + 1; j < n; ++j) { 74 | C center = unit((theta[i] + theta[j]) * .5); 75 | double r = sin((theta[j] - theta[i]) * .25) * 2; 76 | C relative = sum * unit((theta[i] + theta[j]) * .25 - PI * .5); 77 | ans += center * (double)i + r * relative; 78 | } 79 | } 80 | ans /= n * (n - 1) * (n - 2LL) / 6; 81 | printf("%.15f %.15f\n", ans.real(), ans.imag()); 82 | 83 | #ifdef LBT 84 | LOG("Time: %dms\n", int ((clock() 85 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 86 | #endif 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /part2/agc039_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define LOG(FMT...) fprintf(stderr, FMT) 12 | 13 | using namespace std; 14 | 15 | typedef long long ll; 16 | 17 | const int N = 41; 18 | 19 | int n; 20 | char a[N][N]; 21 | ll dp[N][N][N], dp2[N][N][N][N], dp3[N][N][N]; 22 | 23 | ll dfs2(int l1, int r1, int l2, int r2); 24 | 25 | ll dfs(int l, int m, int r) { 26 | if (dp[l][m][r] != -1) 27 | return dp[l][m][r]; 28 | if (l == r) 29 | return dp[l][m][r] = 1; 30 | dp[l][m][r] = 0; 31 | for (int i = l; i < m; i += 2) 32 | for (int j = r; j > m; j -= 2) 33 | dp[l][m][r] += dfs2(l, i, j, r) * dfs(i + 1, m, j - 1); 34 | return dp[l][m][r]; 35 | } 36 | 37 | ll dfs3(int p, int l, int r) { 38 | if (dp3[p][l][r] != -1) 39 | return dp3[p][l][r]; 40 | dp3[p][l][r] = 0; 41 | for (int i = l; i <= r; ++i) 42 | if (a[p][i]) 43 | dp3[p][l][r] += dfs(l, i, r); 44 | return dp3[p][l][r]; 45 | } 46 | 47 | ll dfs2(int l1, int r1, int l2, int r2) { 48 | if (dp2[l1][r1][l2][r2] != -1) 49 | return dp2[l1][r1][l2][r2]; 50 | dp2[l1][r1][l2][r2] = 0; 51 | for (int i = l1; i <= r1; ++i) 52 | dp2[l1][r1][l2][r2] += dfs(l1, i, r1) * dfs3(i, l2, r2); 53 | return dp2[l1][r1][l2][r2]; 54 | } 55 | 56 | int main() { 57 | #ifdef LBT 58 | freopen("test.in", "r", stdin); 59 | #endif 60 | 61 | scanf("%d", &n); 62 | for (int i = 0; i < n * 2; ++i) 63 | scanf("%s", a[i]); 64 | for (int i = 0; i < n * 2; ++i) 65 | for (int j = 0; j < n * 2; ++j) 66 | a[i][j] -= '0'; 67 | 68 | memset(dp, -1, sizeof(dp)); 69 | memset(dp2, -1, sizeof(dp2)); 70 | memset(dp3, -1, sizeof(dp3)); 71 | printf("%lld\n", dfs3(0, 1, n * 2 - 1)); 72 | 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /part2/arc091_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 210; 48 | 49 | int main() { 50 | #ifdef LBT 51 | freopen("test.in", "r", stdin); 52 | int nol_cl = clock(); 53 | #endif 54 | ios::sync_with_stdio(false); 55 | cin.tie(nullptr); 56 | 57 | int n; 58 | cin >> n; 59 | int sg = 0; 60 | while (n--) { 61 | int a, k; 62 | cin >> a >> k; 63 | while (a % k) { 64 | int per = a / k + 1, remain = a % k; 65 | a -= (remain + per - 1) / per * per; 66 | } 67 | sg ^= a / k; 68 | } 69 | puts(sg ? "Takahashi" : "Aoki"); 70 | 71 | #ifdef LBT 72 | LOG("Time: %dms\n", int ((clock() 73 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 74 | #endif 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /part2/arc093_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 16, P = 1000000007; 48 | 49 | int n, m; 50 | int a[N + 1], dp[N + 1][1 << N]; 51 | int fac[(1 << N) + 5], ifac[(1 << N) + 5]; 52 | 53 | void prepare(int n) { 54 | ifac[1] = 1; 55 | for (int i = 2; i <= n; ++i) ifac[i] = -(P / i) * (ll)ifac[P % i] % P + P; 56 | ifac[0] = 1; 57 | for (int i = 1; i <= n; ++i) ifac[i] = ifac[i - 1] * (ll)ifac[i] % P; 58 | fac[0] = 1; 59 | for (int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * (ll)i % P; 60 | } 61 | 62 | int fall(int n, int m) { 63 | if (m < 0 || m > n) return 0; 64 | return fac[n] * (ll)ifac[n - m] % P; 65 | } 66 | 67 | int main() { 68 | #ifdef LBT 69 | freopen("test.in", "r", stdin); 70 | int nol_cl = clock(); 71 | #endif 72 | ios::sync_with_stdio(false); 73 | cin.tie(nullptr); 74 | 75 | cin >> n >> m; 76 | for (int i = 1; i <= m; ++i) 77 | cin >> a[i]; 78 | prepare(1 << n); 79 | dp[m][0] = 1; 80 | for (int i = m; i; --i) { 81 | memcpy(dp[i - 1], dp[i], sizeof(dp[i])); 82 | for (int j = 0; j < 1 << n; ++j) 83 | for (int k = 0; k < n; ++k) 84 | if (!((j >> k) & 1)) 85 | dp[i - 1][j | (1 << k)] = (dp[i - 1][j | (1 << k)] + (ll)(P - fall((1 << n) - a[i] - j, (1 << k) - 1)) * dp[i][j] % P * (1 << k)) % P; 86 | } 87 | int ans = 0; 88 | for (int i = 0; i < 1 << n; ++i) 89 | ans = (ans + dp[0][i] * (ll)fac[(1 << n) - 1 - i]) % P; 90 | ans = ans * (1LL << n) % P; 91 | cout << ans << '\n'; 92 | 93 | #ifdef LBT 94 | LOG("Time: %dms\n", int ((clock() 95 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 96 | #endif 97 | return 0; 98 | } 99 | -------------------------------------------------------------------------------- /part2/arc095_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 100010; 49 | 50 | int n; 51 | int dis[N], cnt[N]; 52 | bool vis[N]; 53 | vector g[N]; 54 | 55 | void dfs1(int u) { 56 | vis[u] = true; 57 | for (int v : g[u]) 58 | if (!vis[v]) { 59 | dis[v] = dis[u] + 1; 60 | dfs1(v); 61 | } 62 | } 63 | 64 | int dfn; 65 | int tmp[N]; 66 | 67 | void dfs2(int u, int t) { 68 | vis[u] = true; 69 | for (int v : g[u]) 70 | if (!vis[v] && (g[v].size() >= 2 || v == t)) { 71 | int link = (int)g[v].size() - (v != t); 72 | --dfn; 73 | tmp[dfn] = dfn - link + 2; 74 | while (--link) { 75 | --dfn; 76 | tmp[dfn] = dfn + 2; 77 | } 78 | dfs2(v, t); 79 | break; 80 | } 81 | } 82 | 83 | vector solve(int s, int t) { 84 | memset(vis, 0, sizeof(vis)); 85 | dfn = n - 1; 86 | tmp[dfn] = n; 87 | dfs2(s, t); 88 | return vector(tmp, tmp + n); 89 | } 90 | 91 | int main() { 92 | ios::sync_with_stdio(false); 93 | cin.tie(nullptr); 94 | 95 | cin >> n; 96 | if (n == 2) { 97 | cout << "1 2\n"; 98 | return 0; 99 | } 100 | for (int rep = 1; rep < n; ++rep) { 101 | int u, v; 102 | cin >> u >> v; 103 | g[u].push_back(v); 104 | g[v].push_back(u); 105 | } 106 | dfs1(1); 107 | int rt = 0; 108 | for (int i = 1; i <= n; ++i) 109 | if (g[i].size() >= 2 && (rt == 0 || dis[i] > dis[rt])) 110 | rt = i; 111 | memset(vis, 0, sizeof(vis)); 112 | dis[rt] = 0; 113 | dfs1(rt); 114 | int tr = rt; 115 | for (int i = 1; i <= n; ++i) 116 | if (g[i].size() >= 2) { 117 | if (cnt[dis[i]]++) { 118 | cout << "-1\n"; 119 | return 0; 120 | } 121 | if (dis[i] > dis[tr]) 122 | tr = i; 123 | } 124 | int s = 0, t = 0; 125 | for (int v : g[rt]) 126 | if (g[v].size() < 2) { 127 | s = v; 128 | break; 129 | } 130 | for (int v : g[tr]) 131 | if (g[v].size() < 2 && v != s) { 132 | t = v; 133 | break; 134 | } 135 | cout << min(solve(s, t), solve(t, s)) << '\n'; 136 | 137 | return 0; 138 | } 139 | -------------------------------------------------------------------------------- /part2/arc096_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | int main() { 48 | #ifdef LBT 49 | freopen("test.in", "r", stdin); 50 | int nol_cl = clock(); 51 | #endif 52 | ios::sync_with_stdio(false); 53 | cin.tie(nullptr); 54 | 55 | int n, P; 56 | cin >> n >> P; 57 | vector ifac(n + 1); 58 | ifac[1] = 1; 59 | for (int i = 2; i <= n; ++i) 60 | ifac[i] = -(P / i) * (ll)ifac[P % i] % P + P; 61 | ifac[0] = 1; 62 | for (int i = 1; i <= n; ++i) 63 | ifac[i] = ifac[i - 1] * (ll)ifac[i] % P; 64 | 65 | vector> stirling2(n + 2, vector(n + 2)); 66 | stirling2[0][0] = 1; 67 | for (int i = 1; i <= n + 1; ++i) 68 | for (int j = 1; j <= i; ++j) 69 | stirling2[i][j] = (stirling2[i - 1][j - 1] + stirling2[i - 1][j] * (ll)j) % P; 70 | vector pw2(n + 1), ppw2(n * n + 1); 71 | pw2[0] = 2; 72 | for (int i = 1; i <= n; ++i) 73 | pw2[i] = pw2[i - 1] * (ll)pw2[i - 1] % P; 74 | ppw2[0] = 1; 75 | for (int i = 1; i <= n * n; ++i) 76 | ppw2[i] = (ppw2[i - 1] << 1) % P; 77 | int ans = 0; 78 | for (int k = 0; k <= n; ++k) 79 | for (int i = 0; i <= n; ++i) { 80 | int coe = (stirling2[n - i][k + 1] * (k + 1LL) + stirling2[n - i][k]) % P * ifac[n - i] % P; 81 | if ((n - i) & 1) coe = (P - coe) % P; 82 | ans = (ans + coe * (ll)pw2[i] % P * ppw2[i * k] % P * ifac[i]) % P; 83 | } 84 | for (int i = 1; i <= n; ++i) 85 | ans = ans * (ll)i % P; 86 | cout << ans << '\n'; 87 | 88 | #ifdef LBT 89 | LOG("Time: %dms\n", int ((clock() 90 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 91 | #endif 92 | return 0; 93 | } 94 | -------------------------------------------------------------------------------- /part2/arc096_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | typedef vector vi; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | ostream& operator<<(ostream& os, const pair& unit) { 39 | return os << unit.first << "^" << unit.second; 40 | } 41 | 42 | template 43 | ostream& operator<<(ostream& os, const vector& v) { 44 | if (!v.empty()) { 45 | os << v.front(); 46 | for (int i = 1; i < v.size(); ++i) 47 | os << ' ' << v[i]; 48 | } 49 | return os; 50 | } 51 | 52 | const int N = 51; 53 | 54 | const int C = N * N * N, INF = (1 << 30) - 10; 55 | 56 | struct Knap { 57 | int V; 58 | int dp[C]; 59 | 60 | void init(int V) { 61 | this->V = V; 62 | fill(dp + 1, dp + V + 1, INF); 63 | } 64 | 65 | void addsingle(int w, int v) { 66 | for (int i = V; i >= w; --i) 67 | dp[i] = min(dp[i - w] + v, dp[i]); 68 | } 69 | 70 | void add(int w, int v, int c) { 71 | int k = 1; 72 | while (k <= c) { 73 | addsingle(w * k, min(v * (ll)k, (ll)INF)); 74 | c -= k; 75 | k <<= 1; 76 | } 77 | if (c > 0) 78 | addsingle(w * c, min(v * (ll)c, (ll)INF)); 79 | } 80 | } knap; 81 | 82 | struct Ele { 83 | int m, s, w; 84 | 85 | Ele() {} 86 | 87 | Ele(int m, int s, int w) : m(m), s(s), w(w) {} 88 | 89 | bool operator>(const Ele& rhs) const { return s * (ll)rhs.m > rhs.s * (ll)m; } 90 | }; 91 | 92 | int n, x, d; 93 | int m[N], p[N], s[N]; 94 | int ec; 95 | Ele e[N]; 96 | 97 | int main() { 98 | #ifdef LBT 99 | freopen("test.in", "r", stdin); 100 | int nol_cl = clock(); 101 | #endif 102 | ios::sync_with_stdio(false); 103 | cin.tie(nullptr); 104 | 105 | cin >> n >> x >> d >> m[1]; 106 | for (int i = 2; i <= n; ++i) 107 | cin >> m[i] >> p[i]; 108 | fill(s + 1, s + n + 1, 1); 109 | for (int i = n; i > 1; --i) { 110 | s[p[i]] += s[i]; 111 | m[p[i]] = min(m[i] + m[p[i]], x + 1); 112 | } 113 | knap.init(n * n * n); 114 | for (int i = 1; i <= n; ++i) { 115 | int lmt = i == 1 ? INF : d; 116 | knap.add(s[i], m[i], min(n, lmt)); 117 | if (lmt > n) 118 | e[++ec] = Ele(m[i], s[i], lmt - n); 119 | } 120 | sort(e + 1, e + ec + 1, greater()); 121 | int ans = 0; 122 | for (int i = 0; i <= n * n * n; ++i) { 123 | if (knap.dp[i] > x) continue; 124 | int rest = x - knap.dp[i], cur = i; 125 | for (int j = 1; j <= ec; ++j) { 126 | int got = min(e[j].w, rest / e[j].m); 127 | rest -= got * e[j].m; 128 | cur += e[j].s * got; 129 | } 130 | ans = max(ans, cur); 131 | } 132 | cout << ans << '\n'; 133 | 134 | #ifdef LBT 135 | LOG("Time: %dms\n", int ((clock() 136 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 137 | #endif 138 | return 0; 139 | } 140 | -------------------------------------------------------------------------------- /part2/arc097_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #define LOG(FMT...) fprintf(stderr, FMT) 8 | 9 | using namespace std; 10 | 11 | struct E { 12 | int v; 13 | E* next; 14 | }; 15 | 16 | const int N = 200010; 17 | 18 | int n, good; 19 | char col[N]; 20 | int deg[N], dp1[N], dp2[N]; 21 | bool vis[N], ct[N], f[N]; 22 | 23 | E epool[N * 2], *etop; 24 | E* g[N]; 25 | 26 | void adde(int u, int v) { 27 | E* p = etop++; 28 | p->v = v; 29 | p->next = g[u]; 30 | g[u] = p; 31 | ++deg[u]; 32 | } 33 | 34 | void dfs1(int u) { 35 | vis[u] = true; 36 | for (E* p = g[u]; p; p = p->next) 37 | if (!vis[p->v] && !ct[p->v]) { 38 | dfs1(p->v); 39 | int upd1 = dp1[p->v] + -1 + (f[u] ? 1 : -1), upd2 = dp2[p->v] + -1 + (f[p->v] ? 1 : -1); 40 | good = min({good, dp1[u] + upd2, dp2[u] + upd1}); 41 | dp1[u] = min(dp1[u], upd1); 42 | dp2[u] = min(dp2[u], upd2); 43 | } 44 | } 45 | 46 | int main() { 47 | int tc = 1; 48 | while (tc--) { 49 | memset(g, 0, sizeof(g)); 50 | memset(ct, 0, sizeof(ct)); 51 | memset(deg, 0, sizeof(deg)); 52 | etop = epool; 53 | scanf("%d", &n); 54 | for (int rep = 1; rep < n; ++rep) { 55 | int u, v; 56 | scanf("%d%d", &u, &v); 57 | adde(u, v); 58 | adde(v, u); 59 | } 60 | scanf("%s", col + 1); 61 | for (int i = 1; i <= n; ++i) 62 | col[i] = col[i] == 'B'; 63 | if (count(col + 1, col + n + 1, 1) == n) { 64 | puts("0"); 65 | continue; 66 | } 67 | queue q; 68 | for (int i = 1; i <= n; ++i) { 69 | if (deg[i] == 1 && col[i]) 70 | q.push(i); 71 | } 72 | int cnt = n; 73 | while (!q.empty()) { 74 | --cnt; 75 | int u = q.front(); 76 | ct[u] = true; 77 | q.pop(); 78 | for (E* p = g[u]; p; p = p->next) 79 | if (--deg[p->v] == 1 && col[p->v]) 80 | q.push(p->v); 81 | } 82 | for (int i = 1; i <= n; ++i) 83 | f[i] = col[i] ^ (deg[i] & 1); 84 | int rt = find(col + 1, col + n + 1, 0) - col; 85 | int ans = 2 * (cnt - 1); 86 | for (int i = 1; i <= n; ++i) 87 | if (!ct[i]) 88 | ans += !f[i]; 89 | memset(vis, 0, sizeof(vis)); 90 | memset(dp1, 0, sizeof(dp1)); 91 | memset(dp2, 0, sizeof(dp2)); 92 | good = 0; 93 | dfs1(rt); 94 | printf("%d\n", good + ans); 95 | } 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /part2/arc101_e.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define LOG(FMT...) fprintf(stderr, FMT) 12 | 13 | using namespace std; 14 | 15 | typedef long long ll; 16 | 17 | const int N = 5010, P = 1000000007; 18 | 19 | int n; 20 | int fac[N]; 21 | int f[N][N]; 22 | int sub[N]; 23 | vector g[N]; 24 | 25 | void dfs(int u) { 26 | sub[u] = 1; 27 | f[u][1] = 1; 28 | for (int v : g[u]) 29 | if (!sub[v]) { 30 | dfs(v); 31 | if (!(sub[v] & 1)) { 32 | for (int i = 1; i <= sub[v] / 2; ++i) 33 | f[v][0] = (f[v][0] + f[v][i * 2] * (ll)fac[i]) % P; 34 | f[v][0] = (P - f[v][0]) % P; 35 | } 36 | static int tmp[N]; 37 | memset(tmp, 0, sizeof(tmp)); 38 | for (int i = 0; i <= sub[u]; ++i) 39 | for (int j = 0; j <= sub[v]; ++j) 40 | tmp[i + j] = (tmp[i + j] + f[u][i] * (ll)f[v][j]) % P; 41 | memcpy(f[u], tmp, sizeof(tmp)); 42 | sub[u] += sub[v]; 43 | } 44 | } 45 | 46 | int main() { 47 | #ifdef LBT 48 | freopen("test.in", "r", stdin); 49 | #endif 50 | 51 | scanf("%d", &n); 52 | for (int rep = 1; rep < n; ++rep) { 53 | int u, v; 54 | scanf("%d%d", &u, &v); 55 | g[u].push_back(v); 56 | g[v].push_back(u); 57 | } 58 | fac[0] = 1; 59 | for (int i = 1; i <= n; ++i) 60 | fac[i] = fac[i - 1] * (2 * i - 1LL) % P; 61 | dfs(1); 62 | int ans = 0; 63 | for (int i = 0; i <= n / 2; ++i) 64 | ans = (ans + fac[i] * (ll)f[1][i * 2]) % P; 65 | printf("%d\n", ans); 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /part2/arc101_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 100010, P = 1000000007; 48 | 49 | int n, m, cnt; 50 | int x[N], y[N], dx[N]; 51 | pair a[N]; 52 | int fw[N]; 53 | 54 | void add(int& x, int y) { 55 | if ((x += y) >= P) 56 | x -= P; 57 | } 58 | 59 | int norm(int x) { return x >= P ? (x - P) : x; } 60 | 61 | int lowBit(int k) { return k & -k; } 62 | 63 | void ch(int k, int x) { 64 | for (; k <= cnt; k += lowBit(k)) 65 | add(fw[k], x); 66 | } 67 | 68 | int qry(int k) { 69 | int ret = 0; 70 | while (k) { 71 | add(ret, fw[k]); 72 | k &= k - 1; 73 | } 74 | return ret; 75 | } 76 | 77 | int main() { 78 | #ifdef LBT 79 | freopen("test.in", "r", stdin); 80 | int nol_cl = clock(); 81 | #endif 82 | ios::sync_with_stdio(false); 83 | cin.tie(nullptr); 84 | 85 | cin >> n >> m; 86 | for (int i = 1; i <= n; ++i) 87 | cin >> x[i]; 88 | for (int i = 1; i <= m; ++i) 89 | cin >> y[i]; 90 | for (int i = 1; i <= n; ++i) { 91 | if (x[i] < y[1] || x[i] > y[m]) 92 | continue; 93 | int id = lower_bound(y + 1, y + m + 1, x[i]) - y; 94 | a[++cnt] = make_pair(x[i] - y[id - 1], y[id] - x[i]); 95 | dx[cnt] = a[cnt].second; 96 | } 97 | int ans = 1; 98 | sort(dx + 1, dx + cnt + 1); 99 | sort(a + 1, a + cnt + 1, [](const auto& lhs, const auto& rhs) { return lhs.first == rhs.first ? (lhs.second > rhs.second) : (lhs.first < rhs.first); }); 100 | for (int i = 1; i <= cnt; ++i) { 101 | if (a[i] == a[i - 1]) continue; 102 | int pos = lower_bound(dx + 1, dx + cnt + 1, a[i].second) - dx; 103 | int cur = norm(qry(pos - 1) + 1); 104 | add(ans, cur); 105 | ch(pos, cur); 106 | } 107 | cout << ans << '\n'; 108 | 109 | #ifdef LBT 110 | LOG("Time: %dms\n", int ((clock() 111 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 112 | #endif 113 | return 0; 114 | } 115 | -------------------------------------------------------------------------------- /part2/arc102_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LOG(FMT...) fprintf(stderr, FMT) 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | typedef unsigned long long ull; 9 | 10 | const int N = 300010; 11 | 12 | int n; 13 | int a[N], pre[N], cnt[N]; 14 | int last[2]; 15 | 16 | void gg() { 17 | puts("No"); 18 | exit(0); 19 | } 20 | 21 | int main() { 22 | scanf("%d", &n); 23 | for (int i = 1; i <= n; ++i) 24 | scanf("%d", &a[i]); 25 | for (int i = 1; i <= n; ++i) 26 | if ((a[i] ^ i) & 1) 27 | gg(); 28 | last[0] = 0; last[1] = -1; 29 | for (int i = 1; i <= n; ++i) { 30 | if (i <= 2) pre[i] = a[i]; 31 | else pre[i] = max(a[i], pre[i - 2]); 32 | if (pre[i] == i) { 33 | if (last[i & 1] < i - 2) { 34 | --cnt[last[i & 1] + 1]; 35 | ++cnt[i]; 36 | } 37 | last[i & 1] = i; 38 | } 39 | } 40 | for (int i = n; i; --i) 41 | if ((cnt[i] += cnt[i + 1]) > 1) 42 | gg(); 43 | int a1 = 0, a2 = 0; 44 | for (int i = 1; i <= n; i += 2) { 45 | if (a[i] < a2) gg(); 46 | if (a[i] < a1) 47 | a2 = a[i]; 48 | else a1 = a[i]; 49 | } 50 | a1 = 0; a2 = 0; 51 | for (int i = 2; i <= n; i += 2) { 52 | if (a[i] < a2) gg(); 53 | if (a[i] < a1) 54 | a2 = a[i]; 55 | else a1 = a[i]; 56 | } 57 | puts("Yes"); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /part2/arc103_d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | typedef vector vi; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | ostream& operator<<(ostream& os, const pair& unit) { 39 | return os << unit.first << "^" << unit.second; 40 | } 41 | 42 | template 43 | ostream& operator<<(ostream& os, const vector& v) { 44 | if (!v.empty()) { 45 | os << v.front(); 46 | for (int i = 1; i < v.size(); ++i) 47 | os << ' ' << v[i]; 48 | } 49 | return os; 50 | } 51 | 52 | #define px first 53 | #define py second 54 | 55 | int main() { 56 | #ifdef LBT 57 | freopen("test.in", "r", stdin); 58 | int nol_cl = clock(); 59 | #endif 60 | ios::sync_with_stdio(false); 61 | cin.tie(nullptr); 62 | 63 | int n; 64 | cin >> n; 65 | vector> p(n); 66 | for (int i = 0; i < n; ++i) 67 | cin >> p[i].px >> p[i].py; 68 | bool par = (p[0].px ^ p[0].py) & 1; 69 | for (int i = 1; i < n; ++i) 70 | if (par != ((p[i].px ^ p[i].py) & 1)) { 71 | puts("-1"); 72 | return 0; 73 | } 74 | // R U L D 75 | int dim = 33; 76 | ll s = (1LL << dim) - 1 + par; 77 | printf("%d\n", dim + !par); 78 | if (!par) 79 | puts("1"); 80 | for (int i = 0; i < dim; ++i) 81 | printf("%lld\n", 1LL << i); 82 | for (const auto& pr : p) { 83 | if (!par) putchar('R'); 84 | ll vx = pr.px + pr.py + s, vy = pr.px - pr.py + s; 85 | for (int i = 1; i <= dim; ++i) 86 | putchar("LDUR"[((vx >> (i - 1)) & 2) | ((vy >> i) & 1)]); 87 | putchar('\n'); 88 | } 89 | 90 | #ifdef LBT 91 | LOG("Time: %dms\n", int ((clock() 92 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 93 | #endif 94 | return 0; 95 | } 96 | -------------------------------------------------------------------------------- /part2/arc103_f.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 100010; 49 | 50 | int prt[N], sub[N]; 51 | ll d[N], sum[N]; 52 | 53 | void gg() { 54 | cout << "-1\n"; 55 | exit(0); 56 | } 57 | 58 | int main() { 59 | ios::sync_with_stdio(false); 60 | cin.tie(nullptr); 61 | 62 | int n; 63 | cin >> n; 64 | for (int i = 1; i <= n; ++i) 65 | cin >> d[i]; 66 | map> mp; 67 | for (int i = 1; i <= n; ++i) 68 | mp.insert(make_pair(d[i], i)); 69 | fill(sub + 1, sub + n + 1, 1); 70 | for (int rep = 1; rep < n; ++rep) { 71 | int u = mp.begin()->second; 72 | mp.erase(mp.begin()); 73 | ll goal = d[u] - (n - 2 * sub[u]); 74 | auto it = mp.find(goal); 75 | if (it == mp.end()) 76 | gg(); 77 | prt[u] = it->second; 78 | sub[it->second] += sub[u]; 79 | sum[it->second] += sum[u] + sub[u]; 80 | } 81 | int rt = mp.begin()->second; 82 | if (sum[rt] != d[rt]) 83 | gg(); 84 | for (int i = 1; i <= n; ++i) 85 | if (i != rt) 86 | cout << i << ' ' << prt[i] << '\n'; 87 | 88 | return 0; 89 | } 90 | -------------------------------------------------------------------------------- /part2/cf506C.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | int n, m, k, p; 48 | 49 | const int N = 100010, M = 5010; 50 | 51 | int h[N], a[N], cnt[M]; 52 | 53 | bool pred(ll x) { 54 | memset(cnt, 0, sizeof(cnt)); 55 | ll sum = 0; 56 | for (int i = 0; i < n; ++i) 57 | if (h[i] + m * (ll)a[i] > x) { 58 | ll cur = (h[i] + m * (ll)a[i] - x + p - 1) / p; 59 | if ((sum += cur) > m * k) 60 | return false; 61 | ll hi = cur * p + x - a[i] * (ll)m; 62 | int j = 0; 63 | while (hi + a[i] * (ll)(m - j) > x) { 64 | ll t = (p - hi + a[i] - 1) / a[i]; 65 | if (hi >= p) 66 | t = 0; 67 | j += t; 68 | hi += a[i] * (ll)t; 69 | hi -= p; 70 | ++cnt[j + 1]; 71 | } 72 | } 73 | for (int i = m; i; --i) { 74 | cnt[i] += cnt[i + 1]; 75 | if (cnt[i] > (m - i + 1) * k) 76 | return false; 77 | } 78 | return true; 79 | } 80 | 81 | int main() { 82 | ios::sync_with_stdio(false); 83 | cin.tie(nullptr); 84 | 85 | cin >> n >> m >> k >> p; 86 | for (int i = 0; i < n; ++i) 87 | cin >> h[i] >> a[i]; 88 | ll l = *max_element(a, a + n), r = 0; 89 | for (int i = 0; i < n; ++i) 90 | r = max(r, h[i] + m * (ll)a[i]); 91 | while (l < r) { 92 | ll mid = (l + r) >> 1; 93 | if (pred(mid)) 94 | r = mid; 95 | else 96 | l = mid + 1; 97 | } 98 | cout << l << '\n'; 99 | 100 | return 0; 101 | } 102 | -------------------------------------------------------------------------------- /part2/cf521D.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LOG(FMT...) fprintf(stderr, FMT) 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | typedef unsigned long long ull; 9 | 10 | struct Fac { 11 | int a; 12 | ll b; 13 | 14 | Fac(int a = 0, ll b = 1) : a(a), b(b) {} 15 | 16 | bool operator<(const Fac& rhs) const { return a * rhs.b > b * rhs.a; } 17 | }; 18 | 19 | const int N = 100010; 20 | 21 | int k, n, m; 22 | int a[N]; 23 | 24 | int typ[N]; 25 | vector > dif[N]; 26 | pair ass[N]; 27 | pair mult[N]; 28 | 29 | int main() { 30 | scanf("%d%d%d", &k, &n, &m); 31 | for (int i = 1; i <= k; ++i) 32 | scanf("%d", &a[i]); 33 | int cnt = 0; 34 | for (int id = 1; id <= n; ++id) { 35 | int t, i, b; 36 | scanf("%d%d%d", &t, &i, &b); 37 | typ[id] = t; 38 | if (t == 1) 39 | ass[i] = max(ass[i], make_pair(b, id)); 40 | else if (t == 2) 41 | dif[i].push_back(make_pair(b, id)); 42 | else 43 | mult[++cnt] = make_pair(Fac(b - 1, 1), id); 44 | } 45 | for (int i = 1; i <= k; ++i) { 46 | if (ass[i].first > a[i]) 47 | dif[i].push_back(make_pair(ass[i].first - a[i], ass[i].second)); 48 | ll sum = a[i]; 49 | sort(dif[i].begin(), dif[i].end(), greater >()); 50 | for (size_t j = 0; j < dif[i].size(); ++j) { 51 | mult[++cnt] = make_pair(Fac(dif[i][j].first, sum), dif[i][j].second); 52 | sum += dif[i][j].first; 53 | } 54 | } 55 | m = min(m, cnt); 56 | sort(mult + 1, mult + cnt + 1); 57 | printf("%d\n", m); 58 | int cn = 0; 59 | for (int j = 1; j <= 3; ++j) 60 | for (int i = 1; i <= m; ++i) 61 | if (typ[mult[i].second] == j) 62 | printf("%d%c", mult[i].second, " \n"[++cn == m]); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /part2/cf559E.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define LOG(FMT...) fprintf(stderr, FMT) 11 | 12 | using namespace std; 13 | 14 | typedef long long ll; 15 | 16 | const int N = 110; 17 | 18 | int n; 19 | int a[N], l[N]; 20 | int pos[N * 3], p[N][3]; 21 | int cn[N]; 22 | pair tmp[N * 3]; 23 | 24 | int dp[N * 3], induce[N * 3][N * 3], myn[N * 3][N * 3]; 25 | 26 | void chkMin(int& x, int y) { 27 | if (x > y) 28 | x = y; 29 | } 30 | 31 | void chkMax(int& x, int y) { 32 | if (x < y) 33 | x = y; 34 | } 35 | 36 | int main() { 37 | #ifdef LBT 38 | freopen("test.in", "r", stdin); 39 | #endif 40 | 41 | scanf("%d", &n); 42 | int tot = 0; 43 | for (int i = 1; i <= n; ++i) { 44 | scanf("%d%d", &a[i], &l[i]); 45 | pos[++tot] = a[i] - l[i]; 46 | tmp[tot] = make_pair(pos[tot], i); 47 | pos[++tot] = a[i]; 48 | tmp[tot] = make_pair(pos[tot], i); 49 | pos[++tot] = a[i] + l[i]; 50 | tmp[tot] = make_pair(pos[tot], i); 51 | } 52 | sort(pos + 1, pos + n * 3 + 1); 53 | sort(tmp + 1, tmp + n * 3 + 1); 54 | for (int i = 1; i <= n * 3; ++i) 55 | p[tmp[i].second][cn[tmp[i].second]++] = i; 56 | pos[n * 3 + 1] = 1 << 30; 57 | for (int i = 1; i <= n * 3 + 1; ++i) 58 | for (int j = 1; j <= n * 3 + 1; ++j) 59 | myn[i][j] = i; 60 | for (int i = 1; i <= n; ++i) 61 | chkMin(myn[p[i][1]][p[i][1]], p[i][0]); 62 | for (int i = 1; i <= n * 3 + 1; ++i) 63 | for (int j = i + 1; j <= n * 3 + 1; ++j) 64 | myn[i][j] = min(myn[i][j - 1], myn[j][j]); 65 | for (int i = 1; i <= n * 3 + 1; ++i) 66 | for (int j = i; j <= n * 3 + 1; ++j) { 67 | if (i == j) { 68 | induce[i][j] = i; 69 | continue; 70 | } 71 | induce[i][j] = i; 72 | induce[i][j] = induce[myn[i][j]][j]; 73 | } 74 | for (int i = 1; i <= n * 3 + 1; ++i) { 75 | for (int j = 1; j <= n; ++j) 76 | if (p[j][1] < i) { 77 | int pp = induce[p[j][0]][p[j][1]]; 78 | chkMax(dp[i], dp[pp] + pos[p[j][1]] - pos[pp]); 79 | if (p[j][2] < i) { 80 | if (myn[p[j][1] + 1][p[j][2]] > p[j][1]) 81 | chkMax(dp[i], dp[p[j][1]] + pos[p[j][2]] - pos[p[j][1]]); 82 | else { 83 | pp = induce[myn[p[j][1] + 1][p[j][2]]][p[j][1] - 1]; 84 | chkMax(dp[i], dp[pp] + pos[p[j][2]] - pos[pp]); 85 | } 86 | } else { 87 | pp = p[j][1]; 88 | if (p[j][1] + 1 <= i - 1) 89 | if (myn[p[j][1] + 1][i - 1] < p[j][1]) 90 | pp = induce[myn[p[j][1] + 1][i - 1]][p[j][1] - 1]; 91 | chkMax(dp[i], dp[pp] + pos[i] - pos[pp]); 92 | } 93 | } 94 | } 95 | printf("%d\n", dp[n * 3 + 1]); 96 | 97 | return 0; 98 | } 99 | -------------------------------------------------------------------------------- /part2/cf566C.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define LOG(FMT...) fprintf(stderr, FMT) 23 | 24 | using namespace std; 25 | 26 | typedef long long ll; 27 | typedef unsigned long long ull; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | const int N = 200010; 49 | 50 | int n; 51 | int w[N], sub[N], heav[N]; 52 | vector> g[N]; 53 | bool vis[N]; 54 | int ql, qr; 55 | int que[N], prt[N]; 56 | 57 | double tot, totDer; 58 | double der[N]; 59 | 60 | void dfs(int u, int p, int dist, int b) { 61 | double v = sqrt(dist) * w[u]; 62 | tot += v * dist; 63 | totDer += v; 64 | der[b] += v; 65 | for (const auto& pr : g[u]) 66 | if (pr.first != p) 67 | dfs(pr.first, u, dist + pr.second, b); 68 | } 69 | 70 | int main() { 71 | ios::sync_with_stdio(false); 72 | cin.tie(nullptr); 73 | 74 | cin >> n; 75 | for (int i = 1; i <= n; ++i) 76 | cin >> w[i]; 77 | for (int rep = 1; rep < n; ++rep) { 78 | int u, v, w; 79 | cin >> u >> v >> w; 80 | g[u].emplace_back(v, w); 81 | g[v].emplace_back(u, w); 82 | } 83 | pair ans(numeric_limits::max(), -1); 84 | int u = 1; 85 | while (!vis[u]) { 86 | ql = qr = 0; 87 | que[qr++] = u; 88 | prt[u] = 0; 89 | while (ql < qr) { 90 | u = que[ql++]; 91 | vis[u] = true; 92 | for (const auto& pr : g[u]) 93 | if (!vis[pr.first]) { 94 | prt[pr.first] = u; 95 | que[qr++] = pr.first; 96 | } 97 | } 98 | for (int i = 0; i < qr; ++i) { 99 | vis[que[i]] = false; 100 | sub[que[i]] = 1; 101 | heav[que[i]] = 1; 102 | } 103 | int cent = que[qr - 1]; 104 | for (int i = qr - 1; i >= 0; --i) { 105 | u = que[i]; 106 | if (i) 107 | sub[prt[u]] += sub[u]; 108 | heav[prt[u]] = max(heav[prt[u]], sub[u]); 109 | heav[u] = max(heav[u], qr - sub[u]); 110 | if (heav[u] < heav[cent]) 111 | cent = u; 112 | } 113 | vis[cent] = true; 114 | tot = 0; 115 | totDer = 0; 116 | u = cent; 117 | for (const auto& pr : g[cent]) { 118 | der[pr.first] = 0; 119 | dfs(pr.first, cent, pr.second, pr.first); 120 | } 121 | for (const auto& pr : g[cent]) { 122 | if (totDer - 2 * der[pr.first] < 0) { 123 | u = pr.first; 124 | } 125 | } 126 | ans = min(ans, make_pair(tot, cent)); 127 | } 128 | 129 | cout.precision(10); 130 | cout << ans.second << ' ' << ans.first << '\n'; 131 | 132 | return 0; 133 | } 134 | -------------------------------------------------------------------------------- /part2/cf585E.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 20000010, M = 500010, P = 1000000007; 48 | 49 | int n, pc; 50 | int pr[1300000], st[M], x[N], y[N]; 51 | bool vis[N]; 52 | 53 | void add(int& x, int y) { 54 | if ((x += y) >= P) 55 | x -= P; 56 | } 57 | 58 | void sub(int& x, int y) { 59 | if ((x -= y) < 0) 60 | x += P; 61 | } 62 | 63 | int norm(int x) { return x >= P ? x - P : x; } 64 | 65 | void trans(int* a) { 66 | for (int i = 1; i <= pc; ++i) 67 | for (int j = n / pr[i]; j; --j) 68 | add(a[j], a[j * pr[i]]); 69 | } 70 | 71 | void itrans(int* a) { 72 | for (int i = 1; i <= pc; ++i) 73 | for (int j = 1; j <= n / pr[i]; ++j) 74 | sub(a[j], a[j * pr[i]]); 75 | } 76 | 77 | int main() { 78 | #ifdef LBT 79 | freopen("test.in", "r", stdin); 80 | int nol_cl = clock(); 81 | #endif 82 | ios::sync_with_stdio(false); 83 | cin.tie(nullptr); 84 | 85 | int m; 86 | cin >> m; 87 | for (int i = 1; i <= m; ++i) 88 | st[i] = norm(st[i - 1] * 2 + 1); 89 | while (m--) { 90 | int ai; 91 | cin >> ai; 92 | ++x[ai]; 93 | n = max(n, ai); 94 | } 95 | for (int i = 2; i <= n; ++i) { 96 | if (!vis[i]) 97 | pr[++pc] = i; 98 | for (int j = 1; i * pr[j] <= n; ++j) { 99 | vis[i * pr[j]] = true; 100 | if (i % pr[j] == 0) 101 | break; 102 | } 103 | } 104 | trans(x); 105 | for (int i = 1; i <= n; ++i) 106 | y[i] = st[x[i]]; 107 | itrans(y); 108 | y[1] = 0; 109 | trans(y); 110 | for (int i = 1; i <= n; ++i) 111 | x[i] = x[i] * (ll)y[i] % P; 112 | itrans(x); 113 | cout << x[1] << '\n'; 114 | 115 | #ifdef LBT 116 | LOG("Time: %dms\n", int ((clock() 117 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 118 | #endif 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /part2/cf605E.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | 28 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 29 | 30 | template 31 | istream& operator>>(istream& is, vector& v) { 32 | for (T& x : v) 33 | is >> x; 34 | return is; 35 | } 36 | 37 | template 38 | ostream& operator<<(ostream& os, const vector& v) { 39 | if (!v.empty()) { 40 | os << v.front(); 41 | for (int i = 1; i < v.size(); ++i) 42 | os << ' ' << v[i]; 43 | } 44 | return os; 45 | } 46 | 47 | const int N = 1010; 48 | 49 | int n; 50 | double p[N][N]; 51 | bool vis[N]; 52 | double ans[N], rest[N], sum[N]; 53 | 54 | int main() { 55 | #ifdef LBT 56 | freopen("test.in", "r", stdin); 57 | int nol_cl = clock(); 58 | #endif 59 | ios::sync_with_stdio(false); 60 | cin.tie(nullptr); 61 | 62 | scanf("%d", &n); 63 | for (int i = 1; i <= n; ++i) 64 | for (int j = 1; j <= n; ++j) { 65 | int k; 66 | scanf("%d", &k); 67 | p[i][j] = k * 0.01; 68 | } 69 | fill(rest + 1, rest + n + 1, 1); 70 | fill(ans + 1, ans + n, 1e9); 71 | for (int rep = 1; rep < n; ++rep) { 72 | int u = -1; 73 | for (int i = 1; i <= n; ++i) 74 | if (!vis[i] && (u == -1 || ans[u] > ans[i])) 75 | u = i; 76 | vis[u] = true; 77 | for (int i = 1; i <= n; ++i) 78 | if (!vis[i]) { 79 | sum[i] += rest[i] * p[i][u] * ans[u]; 80 | rest[i] *= (1 - p[i][u]); 81 | if (rest[i] != 1) 82 | ans[i] = (1 + sum[i]) / (1 - rest[i]); 83 | } 84 | } 85 | printf("%.15f\n", ans[1]); 86 | 87 | #ifdef LBT 88 | LOG("Time: %dms\n", int ((clock() 89 | -nol_cl) / (double)CLOCKS_PER_SEC * 1000)); 90 | #endif 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /part2/cf674F.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define LOG(FMT...) fprintf(stderr, FMT) 22 | 23 | using namespace std; 24 | 25 | typedef long long ll; 26 | typedef unsigned long long ull; 27 | typedef unsigned int ui; 28 | 29 | // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 30 | 31 | template 32 | istream& operator>>(istream& is, vector& v) { 33 | for (T& x : v) 34 | is >> x; 35 | return is; 36 | } 37 | 38 | template 39 | ostream& operator<<(ostream& os, const vector& v) { 40 | if (!v.empty()) { 41 | os << v.front(); 42 | for (int i = 1; i < v.size(); ++i) 43 | os << ' ' << v[i]; 44 | } 45 | return os; 46 | } 47 | 48 | void exGcd(ll a, ll b, ll& x, ll& y) { 49 | if (!b) { 50 | x = 1; 51 | y = 0; 52 | return; 53 | } 54 | exGcd(b, a % b, y, x); 55 | y -= a / b * x; 56 | } 57 | 58 | ui inv(ui a) { 59 | ll x, y; 60 | exGcd(a, 1LL << 32, x, y); 61 | if (x < 0) x += 1LL << 32; 62 | return x; 63 | } 64 | 65 | ui coe[155]; 66 | 67 | int main() { 68 | ios::sync_with_stdio(false); 69 | cin.tie(nullptr); 70 | 71 | int n, p, q; 72 | cin >> n >> p >> q; 73 | ui ans = 0, cur = 1; 74 | int dig = 0; 75 | p = min(p, n - 1); 76 | coe[0] = 1; 77 | for (int i = 1; i <= p; ++i) { 78 | int v = n - i + 1; 79 | while (!(v & 1)) { 80 | ++dig; 81 | v >>= 1; 82 | } 83 | cur *= ui(v); 84 | v = i; 85 | while (!(v & 1)) { 86 | --dig; 87 | v >>= 1; 88 | } 89 | cur *= inv(v); 90 | if (dig < 32) 91 | coe[i] = cur << dig; 92 | } 93 | for (int i = 1; i <= q; ++i) { 94 | ui r = 0; 95 | for (int j = p; j >= 0; --j) 96 | r = r * ui(i) + coe[j]; 97 | ans ^= r * ui(i); 98 | } 99 | cout << ans << '\n'; 100 | 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /part3/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dmp 3 | *.dvi 4 | *.fd 5 | *.glo 6 | *.gls 7 | *.hd 8 | *.idx 9 | *.ilg 10 | *.ind 11 | *.ins 12 | *.log 13 | *.out 14 | *.swp 15 | *.synctex.gz 16 | *.synctex.gz(busy) 17 | *.tmp 18 | *.toc 19 | *.ver 20 | *.xdv 21 | *.zip 22 | *.pdf 23 | *~ 24 | 25 | *.nav 26 | *.snm 27 | -------------------------------------------------------------------------------- /part3/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EntropyIncreaser/ioi2020-homework/90991e2546842175e71df5419ed0f00c00fa07ab/part3/image1.png --------------------------------------------------------------------------------