└── Problems ├── P1712 ├── output ├── input ├── CMakeLists.txt └── makefile ├── P2106 ├── in ├── out └── makefile ├── P2824 ├── output ├── input └── makefile ├── P1005 ├── output ├── input └── makefile ├── P1018 ├── out ├── in └── makefile ├── P1048 ├── output ├── input ├── CMakeLists.txt ├── 1D │ └── P1048.c └── 2D │ └── P1048.c ├── P1049 ├── output ├── input ├── P1049.c └── makefile ├── P1077 ├── out ├── in └── makefile ├── P1091 ├── out ├── in └── makefile ├── P1103 ├── output ├── input └── makefile ├── P1107 ├── output ├── input └── makefile ├── P1121 ├── out ├── in └── makefile ├── P1122 ├── output ├── input └── makefile ├── P1131 ├── output ├── input └── makefile ├── P1164 ├── output ├── input ├── P1164.c └── makefile ├── P1171 ├── out ├── in └── makefile ├── P1233 ├── out ├── in └── makefile ├── P1280 ├── out ├── in └── makefile ├── P1282 ├── out ├── in └── makefile ├── P1303 ├── output ├── input └── makefile ├── P1336 ├── output └── input ├── P1339 ├── out ├── in └── makefile ├── P1345 ├── out ├── in └── makefile ├── P1352 ├── output └── input ├── P1353 ├── output ├── input └── makefile ├── P1417 ├── out ├── in └── makefile ├── P1508 ├── out ├── in └── makefile ├── P1509 ├── output ├── input └── makefile ├── P1564 ├── output ├── input └── makefile ├── P1565 ├── out ├── in └── makefile ├── P1651 ├── output ├── input └── makefile ├── P1666 ├── out ├── in └── makefile ├── P1714 ├── out ├── in └── makefile ├── P1717 ├── out ├── in └── makefile ├── P1734 ├── input ├── output └── P1734.c ├── P1736 ├── output ├── input └── makefile ├── P1757 ├── output └── input ├── P1782 ├── out ├── in └── makefile ├── P1799 ├── output ├── input ├── P1799.c └── makefile ├── P1868 ├── output └── input ├── P1896 ├── input └── output ├── P1910 ├── output └── input ├── P2014 ├── output └── input ├── P2015 ├── output ├── input └── makefile ├── P2034 ├── out ├── in └── makefile ├── P2053 ├── out ├── in └── makefile ├── P2107 ├── out ├── in └── makefile ├── P2134 ├── in ├── out └── makefile ├── P2170 ├── output ├── input ├── Solution.md └── makefile ├── P2182 ├── out ├── in └── makefile ├── P2187 ├── out ├── in └── makefile ├── P2190 ├── out ├── in └── makefile ├── P2341 ├── output ├── input └── makefile ├── P2401 ├── input └── output ├── P2408 ├── out ├── in └── makefile ├── P2422 ├── out ├── in └── makefile ├── P2439 ├── output ├── input └── makefile ├── P2517 ├── out ├── in └── makefile ├── P2602 ├── in ├── out └── makefile ├── P2627 ├── output └── input ├── P2629 ├── out ├── in └── makefile ├── P2639 ├── output └── input ├── P2647 ├── out ├── in └── makefile ├── P2657 ├── in ├── out └── makefile ├── P2679 ├── output ├── input └── makefile ├── P2690 ├── output ├── input ├── makefile └── P2690.c ├── P2704 ├── output └── input ├── P2863 ├── c │ ├── out │ ├── in │ └── makefile └── cc │ ├── out │ ├── in │ └── makefile ├── P2871 ├── output └── input ├── P2889 ├── output ├── input └── makefile ├── P2915 ├── output └── input ├── P2925 ├── output ├── input ├── P2925.c └── makefile ├── P3071 ├── out ├── in └── makefile ├── P3146 ├── output └── input ├── P3177 ├── output ├── input └── makefile ├── P3195 ├── output ├── input └── makefile ├── P3381 ├── out ├── in └── makefile ├── P3387 ├── output ├── input └── makefile ├── P3408 ├── out ├── in └── makefile ├── P3800 ├── output ├── input ├── makefile └── Solution.md ├── P3805 ├── out ├── in └── makefile ├── P3809 ├── in ├── out └── makefile ├── P3817 ├── out ├── in ├── makefile └── P3817.c ├── P4160 ├── in ├── out └── makefile ├── P4362 ├── out ├── in └── makefile ├── P4722 ├── out ├── in └── makefile ├── P4805 ├── out ├── in └── makefile ├── P5144 ├── out ├── in └── makefile ├── P5146 ├── output ├── input ├── P5146_1.c └── P5146_2.c ├── P5202 ├── out ├── in └── makefile ├── P5994 ├── out ├── in └── makefile ├── P6040 ├── out ├── in └── makefile ├── P6855 ├── out ├── in └── makefile ├── P7535 ├── out ├── in └── makefile ├── P7925 ├── out ├── in └── makefile ├── P1043 ├── out ├── in └── makefile ├── P1060 ├── output ├── input ├── CMakeLists.txt ├── 1D │ └── P1060.c └── 2D │ └── P1060.c ├── P1063 ├── output ├── input └── makefile ├── P1169 ├── out ├── in └── makefile ├── P1220 ├── output ├── input └── makefile ├── P1429 ├── output ├── input └── makefile ├── P1433 ├── output ├── input └── makefile ├── P1450 ├── out ├── in └── makefile ├── P1453 ├── output ├── input └── makefile ├── P1483 ├── out ├── in └── makefile ├── P1507 ├── output ├── input └── P1507.c ├── P1533 ├── output ├── input └── makefile ├── P1558 ├── output ├── input ├── CMakeLists.txt └── makefile ├── P1616 ├── output └── input ├── P1650 ├── output ├── input └── makefile ├── P1776 ├── 单调队列 │ ├── output │ └── input └── 二进制拆分 │ ├── output │ └── input ├── P1802 ├── output ├── input ├── Warning.md ├── P1802.c └── makefile ├── P1879 ├── output └── input ├── P2306 ├── out ├── in ├── NOTICE.md └── makefile ├── P2585 ├── output ├── input └── makefile ├── P2722 ├── output ├── input └── P2722.c ├── P2746 ├── output ├── input └── makefile ├── P2966 ├── out ├── in └── makefile ├── P3377 ├── out ├── in └── makefile ├── P3384 ├── out ├── in └── makefile ├── P3391 ├── out ├── in └── makefile ├── P4014 ├── out ├── in └── makefile ├── P4933 ├── output1 ├── output2 ├── input1 └── input2 ├── P5788 ├── out ├── in ├── makefile └── P5788.c ├── P5958 ├── out ├── in └── makefile ├── P1410 ├── output ├── input └── makefile ├── P1430 ├── output ├── input └── makefile ├── P1759 ├── output ├── input └── makefile ├── P1854 ├── output ├── input └── makefile ├── P1857 ├── out ├── in └── makefile ├── P1880 ├── input ├── output └── makefile ├── P1987 ├── out ├── in └── makefile ├── P3545 ├── out ├── in └── makefile ├── P3915 ├── output └── input ├── P4141 ├── input └── output ├── P4999 ├── out ├── in └── makefile ├── U138763 ├── output ├── input └── makefile ├── P1040 ├── input ├── output └── makefile ├── P1428 ├── input ├── input1 ├── README.md ├── SBT │ ├── P1428.c │ └── CMakeLists.txt ├── Solution.md └── BIT │ └── CMakeLists.txt ├── P1440 ├── in ├── out └── makefile ├── P2574 ├── output ├── Solution.md ├── input ├── CMakeLists.txt └── makefile ├── P1168 ├── input ├── Solution.md ├── CMakeLists.txt └── makefile ├── P1281 ├── output ├── input └── makefile ├── P1536 ├── out ├── in └── makefile ├── P1723 ├── out ├── in └── makefile ├── P3379 ├── out ├── in └── makefile ├── P1356 ├── output ├── input └── makefile ├── P1944 ├── output ├── input └── makefile ├── P4552 ├── input ├── P4552.c ├── Solution.md ├── CMakeLists.txt └── makefile ├── P1801 ├── input ├── CMakeLists.txt └── makefile ├── P1973 ├── output ├── input └── makefile ├── P3919 ├── output ├── input └── makefile ├── P4095 ├── output ├── input └── makefile ├── P1438 ├── input ├── Solution.md ├── CMakeLists.txt └── makefile ├── P1198 ├── input ├── CMakeLists.txt └── makefile ├── P1972 ├── input ├── CMakeLists.txt └── makefile ├── P2068 ├── input ├── P2068.c ├── CMakeLists.txt └── makefile ├── P1529 ├── CMakeLists.txt └── makefile ├── P4868 ├── input ├── Solution.md ├── CMakeLists.txt └── makefile ├── P1343 ├── CMakeLists.txt └── makefile ├── P3376 ├── CMakeLists.txt ├── P3376.cpp └── makefile ├── P3810 ├── out ├── in └── makefile ├── P2073 ├── P2073.c ├── Solution.md ├── makefile └── CMakeLists.txt ├── P3372 ├── input ├── BIT │ ├── P3372.c │ └── CMakeLists.txt └── SegmentTree │ └── CMakeLists.txt ├── P3373 ├── P3373.c ├── input ├── Solution.md ├── CMakeLists.txt └── makefile ├── P5018 ├── P5018.c ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1027 ├── P1027.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1186 ├── P1186.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1330 ├── C │ ├── P1330.c │ ├── makefile │ └── CMakeLists.txt ├── C++ │ ├── P1330.cpp │ ├── CMakeLists.txt │ └── makefile └── Solution.md ├── P1342 ├── P1342.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1347 ├── P1347.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1462 ├── P1462.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1486 ├── P1486.cpp ├── makefile └── CMakeLists.txt ├── P1491 ├── P1491.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1550 ├── P1550.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1576 ├── P1576.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1608 ├── P1608.cpp ├── makefile └── CMakeLists.txt ├── P1629 ├── P1629.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1841 ├── P1841.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1951 ├── P1951.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2055 ├── P2055.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2169 ├── P2169.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2176 ├── P2176.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2756 ├── P2756.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2825 ├── P2825.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2829 ├── P2829.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2865 ├── P2865.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2880 ├── input ├── CMakeLists.txt └── makefile ├── P2939 ├── P2939.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P3003 ├── P3003.cpp ├── makefile └── CMakeLists.txt ├── P3366 ├── P3366.cpp ├── makefile └── CMakeLists.txt ├── P3369 ├── P3369.cpp ├── makefile └── CMakeLists.txt ├── P3386 ├── P3386.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P3393 ├── P3393.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P3871 ├── P3871.cpp ├── Solution.md └── CMakeLists.txt ├── P4480 ├── P4480.cpp ├── makefile └── CMakeLists.txt ├── P4554 ├── P4554.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P4568 ├── P4568.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P4943 ├── P4943.cpp ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2023 ├── input ├── CMakeLists.txt └── makefile ├── P2161 ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2343 ├── Solution.md ├── makefile └── CMakeLists.txt ├── P2417 ├── Solution.md ├── makefile └── CMakeLists.txt ├── P3368 ├── makefile └── CMakeLists.txt ├── P3374 ├── makefile └── CMakeLists.txt ├── P3946 ├── Solution.md ├── makefile └── CMakeLists.txt ├── P1110 ├── makefile └── CMakeLists.txt ├── P1129 ├── makefile └── CMakeLists.txt ├── P1726 ├── makefile └── CMakeLists.txt ├── P1894 ├── makefile └── CMakeLists.txt ├── P1983 ├── makefile └── CMakeLists.txt ├── P2071 ├── makefile └── CMakeLists.txt ├── P2319 ├── makefile └── CMakeLists.txt ├── P2683 ├── makefile └── CMakeLists.txt ├── P4879 ├── CMakeLists.txt ├── input └── makefile └── P2584 ├── output ├── input └── makefile /Problems/P1712/output: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /Problems/P2106/in: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P2824/output: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /Problems/P1005/output: -------------------------------------------------------------------------------- 1 | 82 2 | -------------------------------------------------------------------------------- /Problems/P1018/out: -------------------------------------------------------------------------------- 1 | 62 2 | -------------------------------------------------------------------------------- /Problems/P1048/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1049/output: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /Problems/P1077/out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P1091/out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P1103/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1107/output: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /Problems/P1121/out: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P1122/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1131/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P1164/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1171/out: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1233/out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P1280/out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P1282/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P1303/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P1336/output: -------------------------------------------------------------------------------- 1 | 19 2 | -------------------------------------------------------------------------------- /Problems/P1339/out: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /Problems/P1345/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P1352/output: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /Problems/P1353/output: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P1417/out: -------------------------------------------------------------------------------- 1 | 408 2 | -------------------------------------------------------------------------------- /Problems/P1508/out: -------------------------------------------------------------------------------- 1 | 41 2 | -------------------------------------------------------------------------------- /Problems/P1509/output: -------------------------------------------------------------------------------- 1 | 13 2 | -------------------------------------------------------------------------------- /Problems/P1564/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P1565/out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P1651/output: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /Problems/P1666/out: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Problems/P1714/out: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P1717/out: -------------------------------------------------------------------------------- 1 | 31 2 | -------------------------------------------------------------------------------- /Problems/P1734/input: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /Problems/P1734/output: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P1736/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1757/output: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /Problems/P1782/out: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /Problems/P1799/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P1868/output: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /Problems/P1896/input: -------------------------------------------------------------------------------- 1 | 3 2 2 | -------------------------------------------------------------------------------- /Problems/P1896/output: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /Problems/P1910/output: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /Problems/P2014/output: -------------------------------------------------------------------------------- 1 | 13 2 | -------------------------------------------------------------------------------- /Problems/P2015/output: -------------------------------------------------------------------------------- 1 | 21 2 | -------------------------------------------------------------------------------- /Problems/P2034/out: -------------------------------------------------------------------------------- 1 | 24 2 | -------------------------------------------------------------------------------- /Problems/P2053/out: -------------------------------------------------------------------------------- 1 | 1.50 2 | -------------------------------------------------------------------------------- /Problems/P2106/out: -------------------------------------------------------------------------------- 1 | 867 2 | -------------------------------------------------------------------------------- /Problems/P2107/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P2134/in: -------------------------------------------------------------------------------- 1 | 6 1 7 2 | -------------------------------------------------------------------------------- /Problems/P2134/out: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /Problems/P2170/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P2182/out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P2187/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P2190/out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P2341/output: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P2401/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | -------------------------------------------------------------------------------- /Problems/P2401/output: -------------------------------------------------------------------------------- 1 | 66 2 | -------------------------------------------------------------------------------- /Problems/P2408/out: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /Problems/P2422/out: -------------------------------------------------------------------------------- 1 | 60 2 | -------------------------------------------------------------------------------- /Problems/P2439/output: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /Problems/P2517/out: -------------------------------------------------------------------------------- 1 | 34 2 | -------------------------------------------------------------------------------- /Problems/P2602/in: -------------------------------------------------------------------------------- 1 | 1 99 2 | -------------------------------------------------------------------------------- /Problems/P2627/output: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /Problems/P2629/out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P2639/output: -------------------------------------------------------------------------------- 1 | 56 2 | -------------------------------------------------------------------------------- /Problems/P2647/out: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Problems/P2657/in: -------------------------------------------------------------------------------- 1 | 25 50 2 | -------------------------------------------------------------------------------- /Problems/P2657/out: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /Problems/P2679/output: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P2690/output: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Problems/P2704/output: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Problems/P2863/c/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P2863/cc/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P2871/output: -------------------------------------------------------------------------------- 1 | 23 2 | -------------------------------------------------------------------------------- /Problems/P2889/output: -------------------------------------------------------------------------------- 1 | 43 2 | -------------------------------------------------------------------------------- /Problems/P2915/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P2925/output: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /Problems/P3071/out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P3146/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P3177/output: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P3195/output: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Problems/P3381/out: -------------------------------------------------------------------------------- 1 | 50 280 -------------------------------------------------------------------------------- /Problems/P3387/output: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Problems/P3408/out: -------------------------------------------------------------------------------- 1 | 50 2 | -------------------------------------------------------------------------------- /Problems/P3800/output: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P3805/out: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /Problems/P3809/in: -------------------------------------------------------------------------------- 1 | ababa 2 | -------------------------------------------------------------------------------- /Problems/P3817/out: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /Problems/P4160/in: -------------------------------------------------------------------------------- 1 | 5 5 5 2 | -------------------------------------------------------------------------------- /Problems/P4362/out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Problems/P4722/out: -------------------------------------------------------------------------------- 1 | 14 2 | -------------------------------------------------------------------------------- /Problems/P4805/out: -------------------------------------------------------------------------------- 1 | 48 2 | -------------------------------------------------------------------------------- /Problems/P5144/out: -------------------------------------------------------------------------------- 1 | 15 2 | -------------------------------------------------------------------------------- /Problems/P5146/output: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /Problems/P5202/out: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Problems/P5994/out: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /Problems/P6040/out: -------------------------------------------------------------------------------- 1 | 27 2 | -------------------------------------------------------------------------------- /Problems/P6855/out: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Problems/P7535/out: -------------------------------------------------------------------------------- 1 | 18 2 | -------------------------------------------------------------------------------- /Problems/P7925/out: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /Problems/P1043/out: -------------------------------------------------------------------------------- 1 | 7 2 | 81 3 | -------------------------------------------------------------------------------- /Problems/P1060/output: -------------------------------------------------------------------------------- 1 | 3900 2 | -------------------------------------------------------------------------------- /Problems/P1063/output: -------------------------------------------------------------------------------- 1 | 710 2 | -------------------------------------------------------------------------------- /Problems/P1077/in: -------------------------------------------------------------------------------- 1 | 2 4 2 | 3 2 3 | -------------------------------------------------------------------------------- /Problems/P1169/out: -------------------------------------------------------------------------------- 1 | 4 2 | 6 3 | -------------------------------------------------------------------------------- /Problems/P1220/output: -------------------------------------------------------------------------------- 1 | 270 2 | -------------------------------------------------------------------------------- /Problems/P1303/input: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /Problems/P1429/output: -------------------------------------------------------------------------------- 1 | 1.0000 2 | -------------------------------------------------------------------------------- /Problems/P1433/output: -------------------------------------------------------------------------------- 1 | 7.41 2 | -------------------------------------------------------------------------------- /Problems/P1450/out: -------------------------------------------------------------------------------- 1 | 4 2 | 27 3 | -------------------------------------------------------------------------------- /Problems/P1453/output: -------------------------------------------------------------------------------- 1 | 12.0 2 | -------------------------------------------------------------------------------- /Problems/P1483/out: -------------------------------------------------------------------------------- 1 | 8 2 | 13 3 | -------------------------------------------------------------------------------- /Problems/P1507/output: -------------------------------------------------------------------------------- 1 | 550 2 | -------------------------------------------------------------------------------- /Problems/P1533/output: -------------------------------------------------------------------------------- 1 | 3 2 | 2 3 | -------------------------------------------------------------------------------- /Problems/P1558/output: -------------------------------------------------------------------------------- 1 | 2 2 | 1 3 | -------------------------------------------------------------------------------- /Problems/P1616/output: -------------------------------------------------------------------------------- 1 | 140 2 | -------------------------------------------------------------------------------- /Problems/P1650/output: -------------------------------------------------------------------------------- 1 | 200 2 | -------------------------------------------------------------------------------- /Problems/P1776/单调队列/output: -------------------------------------------------------------------------------- 1 | 47 2 | -------------------------------------------------------------------------------- /Problems/P1802/output: -------------------------------------------------------------------------------- 1 | 1060 2 | -------------------------------------------------------------------------------- /Problems/P1879/output: -------------------------------------------------------------------------------- 1 | 4402955 2 | -------------------------------------------------------------------------------- /Problems/P2306/out: -------------------------------------------------------------------------------- 1 | no 2 | 13 3 | -------------------------------------------------------------------------------- /Problems/P2408/in: -------------------------------------------------------------------------------- 1 | 5 2 | aabaa 3 | -------------------------------------------------------------------------------- /Problems/P2585/output: -------------------------------------------------------------------------------- 1 | 5 2 2 | -------------------------------------------------------------------------------- /Problems/P2679/input: -------------------------------------------------------------------------------- 1 | GRGGRG 2 | -------------------------------------------------------------------------------- /Problems/P2722/output: -------------------------------------------------------------------------------- 1 | 605 2 | -------------------------------------------------------------------------------- /Problems/P2746/output: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /Problems/P2966/out: -------------------------------------------------------------------------------- 1 | 8 2 | 9 3 | -------------------------------------------------------------------------------- /Problems/P3377/out: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | -------------------------------------------------------------------------------- /Problems/P3384/out: -------------------------------------------------------------------------------- 1 | 2 2 | 21 3 | -------------------------------------------------------------------------------- /Problems/P3391/out: -------------------------------------------------------------------------------- 1 | 4 3 2 1 5 2 | -------------------------------------------------------------------------------- /Problems/P3809/out: -------------------------------------------------------------------------------- 1 | 5 3 1 4 2 2 | -------------------------------------------------------------------------------- /Problems/P4014/out: -------------------------------------------------------------------------------- 1 | 5 2 | 14 3 | -------------------------------------------------------------------------------- /Problems/P4160/out: -------------------------------------------------------------------------------- 1 | 1.800000 2 | -------------------------------------------------------------------------------- /Problems/P4933/output1: -------------------------------------------------------------------------------- 1 | 50 2 | -------------------------------------------------------------------------------- /Problems/P4933/output2: -------------------------------------------------------------------------------- 1 | 11153 2 | -------------------------------------------------------------------------------- /Problems/P5788/out: -------------------------------------------------------------------------------- 1 | 2 5 4 5 0 2 | -------------------------------------------------------------------------------- /Problems/P5958/out: -------------------------------------------------------------------------------- 1 | 0.666667 2 | -------------------------------------------------------------------------------- /Problems/P1018/in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 1231 3 | -------------------------------------------------------------------------------- /Problems/P1410/output: -------------------------------------------------------------------------------- 1 | Yes! 2 | No! 3 | -------------------------------------------------------------------------------- /Problems/P1430/output: -------------------------------------------------------------------------------- 1 | -1 2 | 3 3 | -------------------------------------------------------------------------------- /Problems/P1651/input: -------------------------------------------------------------------------------- 1 | 3 2 | 2 3 5 3 | -------------------------------------------------------------------------------- /Problems/P1759/output: -------------------------------------------------------------------------------- 1 | 405 2 | 1 2 3 | -------------------------------------------------------------------------------- /Problems/P1776/二进制拆分/output: -------------------------------------------------------------------------------- 1 | 47 2 | -------------------------------------------------------------------------------- /Problems/P1854/output: -------------------------------------------------------------------------------- 1 | 53 2 | 2 4 5 3 | -------------------------------------------------------------------------------- /Problems/P1857/out: -------------------------------------------------------------------------------- 1 | 1 2 | -1 3 | 3 4 | -------------------------------------------------------------------------------- /Problems/P1880/input: -------------------------------------------------------------------------------- 1 | 4 2 | 4 5 9 4 3 | -------------------------------------------------------------------------------- /Problems/P1880/output: -------------------------------------------------------------------------------- 1 | 43 2 | 54 3 | -------------------------------------------------------------------------------- /Problems/P1987/out: -------------------------------------------------------------------------------- 1 | 47 2 | 104 3 | -------------------------------------------------------------------------------- /Problems/P2585/input: -------------------------------------------------------------------------------- 1 | 1122002010 2 | -------------------------------------------------------------------------------- /Problems/P2629/in: -------------------------------------------------------------------------------- 1 | 4 2 | -3 5 1 2 3 | -------------------------------------------------------------------------------- /Problems/P3545/out: -------------------------------------------------------------------------------- 1 | 3 2 | 1 2 4 3 | -------------------------------------------------------------------------------- /Problems/P3915/output: -------------------------------------------------------------------------------- 1 | YES 2 | NO 3 | -------------------------------------------------------------------------------- /Problems/P4141/input: -------------------------------------------------------------------------------- 1 | 3 2 2 | 1 1 2 3 | -------------------------------------------------------------------------------- /Problems/P4999/out: -------------------------------------------------------------------------------- 1 | 411 2 | 498 3 | -------------------------------------------------------------------------------- /Problems/P5144/in: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1 2 3 4 5 -------------------------------------------------------------------------------- /Problems/P5202/in: -------------------------------------------------------------------------------- 1 | 7 2 2 | HGHGGHG 3 | -------------------------------------------------------------------------------- /Problems/P5788/in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 4 2 3 5 3 | -------------------------------------------------------------------------------- /Problems/U138763/output: -------------------------------------------------------------------------------- 1 | 0 2 5 4 4 2 | -------------------------------------------------------------------------------- /Problems/P1040/input: -------------------------------------------------------------------------------- 1 | 5 2 | 5 7 1 2 10 3 | -------------------------------------------------------------------------------- /Problems/P1040/output: -------------------------------------------------------------------------------- 1 | 145 2 | 3 1 2 4 5 3 | -------------------------------------------------------------------------------- /Problems/P1063/input: -------------------------------------------------------------------------------- 1 | 4 2 | 2 3 5 10 3 | -------------------------------------------------------------------------------- /Problems/P1164/input: -------------------------------------------------------------------------------- 1 | 4 4 2 | 1 1 2 2 3 | -------------------------------------------------------------------------------- /Problems/P1428/input: -------------------------------------------------------------------------------- 1 | 6 2 | 4 3 0 5 1 2 3 | -------------------------------------------------------------------------------- /Problems/P1440/in: -------------------------------------------------------------------------------- 1 | 6 2 2 | 7 8 1 4 3 2 3 | -------------------------------------------------------------------------------- /Problems/P1714/in: -------------------------------------------------------------------------------- 1 | 5 2 2 | 1 2 3 4 5 3 | -------------------------------------------------------------------------------- /Problems/P1799/input: -------------------------------------------------------------------------------- 1 | 5 2 | 1 1 2 5 4 3 | -------------------------------------------------------------------------------- /Problems/P1857/in: -------------------------------------------------------------------------------- 1 | 3 2 | 8 3 | 9 4 | 16 5 | -------------------------------------------------------------------------------- /Problems/P2053/in: -------------------------------------------------------------------------------- 1 | 2 2 2 | 3 2 3 | 1 4 4 | -------------------------------------------------------------------------------- /Problems/P2182/in: -------------------------------------------------------------------------------- 1 | 3 2 1 2 | 100 3 | 001 4 | -------------------------------------------------------------------------------- /Problems/P2422/in: -------------------------------------------------------------------------------- 1 | 6 2 | 3 1 6 4 5 2 3 | -------------------------------------------------------------------------------- /Problems/P2574/output: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | 1 4 | -------------------------------------------------------------------------------- /Problems/P2647/in: -------------------------------------------------------------------------------- 1 | 2 2 | 5 2 3 | 3 5 4 | -------------------------------------------------------------------------------- /Problems/P3805/in: -------------------------------------------------------------------------------- 1 | bbbkkioookiookkooikk 2 | -------------------------------------------------------------------------------- /Problems/P3817/in: -------------------------------------------------------------------------------- 1 | 6 1 2 | 1 6 1 2 0 4 3 | -------------------------------------------------------------------------------- /Problems/P4141/output: -------------------------------------------------------------------------------- 1 | 11 2 | 11 3 | 21 4 | -------------------------------------------------------------------------------- /Problems/P1005/input: -------------------------------------------------------------------------------- 1 | 2 3 2 | 1 2 3 3 | 3 4 2 4 | -------------------------------------------------------------------------------- /Problems/P1121/in: -------------------------------------------------------------------------------- 1 | 7 2 | 2 -4 3 -1 2 -4 3 3 | -------------------------------------------------------------------------------- /Problems/P1168/input: -------------------------------------------------------------------------------- 1 | 7 2 | 1 3 5 7 9 11 6 3 | -------------------------------------------------------------------------------- /Problems/P1233/in: -------------------------------------------------------------------------------- 1 | 5 2 | 4 9 5 2 2 1 3 5 1 4 3 | -------------------------------------------------------------------------------- /Problems/P1281/output: -------------------------------------------------------------------------------- 1 | 1 5 2 | 6 7 3 | 8 9 4 | -------------------------------------------------------------------------------- /Problems/P1345/in: -------------------------------------------------------------------------------- 1 | 3 2 1 2 2 | 1 3 3 | 2 3 4 | -------------------------------------------------------------------------------- /Problems/P1417/in: -------------------------------------------------------------------------------- 1 | 74 1 2 | 502 3 | 2 4 | 47 5 | -------------------------------------------------------------------------------- /Problems/P1430/input: -------------------------------------------------------------------------------- 1 | 2 2 | 1 -1 3 | 2 1 2 4 | -------------------------------------------------------------------------------- /Problems/P1536/out: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 2 4 | 998 5 | -------------------------------------------------------------------------------- /Problems/P1723/out: -------------------------------------------------------------------------------- 1 | 5 2 | 4 3 | 6 4 | 1 5 | 5 6 | -------------------------------------------------------------------------------- /Problems/P2107/in: -------------------------------------------------------------------------------- 1 | 2 10 2 | 1 100 3 | 5 5 4 | -------------------------------------------------------------------------------- /Problems/P2170/input: -------------------------------------------------------------------------------- 1 | 4 3 2 2 | 1 2 3 | 3 4 4 | -------------------------------------------------------------------------------- /Problems/P2190/in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 1 2 36 3 | 4 3 36 4 | -------------------------------------------------------------------------------- /Problems/P3177/input: -------------------------------------------------------------------------------- 1 | 3 1 2 | 1 2 1 3 | 1 3 2 4 | -------------------------------------------------------------------------------- /Problems/P3379/out: -------------------------------------------------------------------------------- 1 | 4 2 | 4 3 | 1 4 | 4 5 | 4 6 | -------------------------------------------------------------------------------- /Problems/P4805/in: -------------------------------------------------------------------------------- 1 | 7 2 | 47 12 12 3 9 9 3 3 | -------------------------------------------------------------------------------- /Problems/P4999/in: -------------------------------------------------------------------------------- 1 | 2 2 | 24 69 3 | 70 120 4 | -------------------------------------------------------------------------------- /Problems/P6040/in: -------------------------------------------------------------------------------- 1 | 5 3 4 1 0 2 | 1 2 3 4 5 3 | -------------------------------------------------------------------------------- /Problems/P1043/in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 4 3 | 3 4 | -1 5 | 2 -------------------------------------------------------------------------------- /Problems/P1131/input: -------------------------------------------------------------------------------- 1 | 3 2 | 1 3 | 1 2 1 4 | 1 3 3 5 | -------------------------------------------------------------------------------- /Problems/P1171/in: -------------------------------------------------------------------------------- 1 | 3 2 | 0 2 1 3 | 1 0 2 4 | 2 1 0 5 | -------------------------------------------------------------------------------- /Problems/P1281/input: -------------------------------------------------------------------------------- 1 | 9 3 2 | 1 2 3 4 5 6 7 8 9 3 | -------------------------------------------------------------------------------- /Problems/P1336/input: -------------------------------------------------------------------------------- 1 | 10 3 2 | 2 1 3 | 1 2 4 | 2 1 5 | -------------------------------------------------------------------------------- /Problems/P1356/output: -------------------------------------------------------------------------------- 1 | Divisible 2 | Not divisible 3 | -------------------------------------------------------------------------------- /Problems/P1428/input1: -------------------------------------------------------------------------------- 1 | 10 2 | 1 1 1 1 1 1 1 1 1 1 3 | -------------------------------------------------------------------------------- /Problems/P1429/input: -------------------------------------------------------------------------------- 1 | 3 2 | 1 1 3 | 1 2 4 | 2 2 5 | -------------------------------------------------------------------------------- /Problems/P1565/in: -------------------------------------------------------------------------------- 1 | 3 2 2 | 4 0 3 | -10 8 4 | -2 -2 5 | -------------------------------------------------------------------------------- /Problems/P1650/input: -------------------------------------------------------------------------------- 1 | 3 2 | 92 83 71 3 | 95 87 74 4 | -------------------------------------------------------------------------------- /Problems/P1666/in: -------------------------------------------------------------------------------- 1 | 3 2 | hello 3 | hell 4 | hi 5 | -------------------------------------------------------------------------------- /Problems/P1717/in: -------------------------------------------------------------------------------- 1 | 2 2 | 1 3 | 10 1 4 | 2 5 5 | 2 -------------------------------------------------------------------------------- /Problems/P1868/input: -------------------------------------------------------------------------------- 1 | 3 2 | 1 3 3 | 7 8 4 | 3 4 5 | -------------------------------------------------------------------------------- /Problems/P1944/output: -------------------------------------------------------------------------------- 1 | ((()))[[[]]][(([]))]()[] 2 | -------------------------------------------------------------------------------- /Problems/P2034/in: -------------------------------------------------------------------------------- 1 | 10 2 2 | 1 2 3 4 5 3 4 5 6 2 3 | -------------------------------------------------------------------------------- /Problems/P2187/in: -------------------------------------------------------------------------------- 1 | 4 2 | noip 3 | 2 4 | ip 5 | mo 6 | -------------------------------------------------------------------------------- /Problems/P2341/input: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 2 3 | 2 1 4 | 2 3 5 | -------------------------------------------------------------------------------- /Problems/P2517/in: -------------------------------------------------------------------------------- 1 | 3 1 1000 2 | 2 4 8 3 | 1 2 4 4 | -------------------------------------------------------------------------------- /Problems/P2602/out: -------------------------------------------------------------------------------- 1 | 9 20 20 20 20 20 20 20 20 20 2 | -------------------------------------------------------------------------------- /Problems/P2925/input: -------------------------------------------------------------------------------- 1 | 7 3 2 | 2 3 | 6 4 | 5 5 | -------------------------------------------------------------------------------- /Problems/P3146/input: -------------------------------------------------------------------------------- 1 | 4 2 | 1 3 | 1 4 | 1 5 | 2 6 | -------------------------------------------------------------------------------- /Problems/P3387/input: -------------------------------------------------------------------------------- 1 | 2 2 2 | 1 1 3 | 1 2 4 | 2 1 5 | -------------------------------------------------------------------------------- /Problems/P3391/in: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1 3 3 | 1 3 4 | 1 4 5 | -------------------------------------------------------------------------------- /Problems/P4552/input: -------------------------------------------------------------------------------- 1 | 4 2 | 1 3 | 1 4 | 2 5 | 2 6 | -------------------------------------------------------------------------------- /Problems/P5146/input: -------------------------------------------------------------------------------- 1 | 10 2 | 1 3 4 6 7 9 10 1 2 9 3 | -------------------------------------------------------------------------------- /Problems/P1048/input: -------------------------------------------------------------------------------- 1 | 70 3 2 | 71 100 3 | 69 1 4 | 1 2 5 | -------------------------------------------------------------------------------- /Problems/P1169/in: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 0 1 3 | 0 1 0 4 | 1 0 0 5 | -------------------------------------------------------------------------------- /Problems/P1282/in: -------------------------------------------------------------------------------- 1 | 4 2 | 6 1 3 | 1 5 4 | 1 3 5 | 1 2 6 | -------------------------------------------------------------------------------- /Problems/P1410/input: -------------------------------------------------------------------------------- 1 | 6 3 1 4 5 8 7 2 | 6 3 2 1 6 5 4 3 | -------------------------------------------------------------------------------- /Problems/P1440/out: -------------------------------------------------------------------------------- 1 | 0 2 | 7 3 | 7 4 | 1 5 | 1 6 | 3 7 | -------------------------------------------------------------------------------- /Problems/P1564/input: -------------------------------------------------------------------------------- 1 | 5 1 2 | 2 3 | 2 4 | 1 5 | 2 6 | 2 7 | -------------------------------------------------------------------------------- /Problems/P1616/input: -------------------------------------------------------------------------------- 1 | 70 3 2 | 71 100 3 | 69 1 4 | 1 2 5 | -------------------------------------------------------------------------------- /Problems/P2306/in: -------------------------------------------------------------------------------- 1 | 3 100 100 2 | 7 10 3 | 6 1 4 | 1 2 5 | -------------------------------------------------------------------------------- /Problems/P2627/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | -------------------------------------------------------------------------------- /Problems/P2639/input: -------------------------------------------------------------------------------- 1 | 56 4 2 | 15 3 | 19 4 | 20 5 | 21 6 | -------------------------------------------------------------------------------- /Problems/P2915/input: -------------------------------------------------------------------------------- 1 | 4 1 2 | 3 3 | 4 4 | 2 5 | 1 6 | -------------------------------------------------------------------------------- /Problems/P3545/in: -------------------------------------------------------------------------------- 1 | 6 2 | 2 2 1 2 1 0 3 | 1 2 2 3 4 4 4 | -------------------------------------------------------------------------------- /Problems/P4933/input1: -------------------------------------------------------------------------------- 1 | 8 2 | 13 14 6 20 27 34 34 41 3 | -------------------------------------------------------------------------------- /Problems/P6855/in: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 1 3 | 2 1 2 4 | 3 1 1 5 | -------------------------------------------------------------------------------- /Problems/P7535/in: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 | 3 4 | 5 5 | 8 6 | 13 7 | -------------------------------------------------------------------------------- /Problems/P1091/in: -------------------------------------------------------------------------------- 1 | 8 2 | 186 186 150 200 160 130 197 220 3 | -------------------------------------------------------------------------------- /Problems/P1103/input: -------------------------------------------------------------------------------- 1 | 4 1 2 | 1 2 3 | 2 4 4 | 3 1 5 | 5 3 6 | -------------------------------------------------------------------------------- /Problems/P1353/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | 5 3 | 3 4 | 4 5 | 2 6 | 10 7 | -------------------------------------------------------------------------------- /Problems/P1433/input: -------------------------------------------------------------------------------- 1 | 4 2 | 1 1 3 | 1 -1 4 | -1 1 5 | -1 -1 6 | -------------------------------------------------------------------------------- /Problems/P1782/in: -------------------------------------------------------------------------------- 1 | 2 1 10 2 | 1 2 3 3 | 3 4 1 4 | -1 8 -16 5 | -------------------------------------------------------------------------------- /Problems/P1801/input: -------------------------------------------------------------------------------- 1 | 7 4 2 | 3 1 -4 2 8 -1000 2 3 | 1 2 6 6 4 | -------------------------------------------------------------------------------- /Problems/P1973/output: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 1 4 | 2 5 | 2 6 | 2 7 | -------------------------------------------------------------------------------- /Problems/P2863/c/in: -------------------------------------------------------------------------------- 1 | 5 4 2 | 2 4 3 | 3 5 4 | 1 2 5 | 4 1 6 | -------------------------------------------------------------------------------- /Problems/P2863/cc/in: -------------------------------------------------------------------------------- 1 | 5 4 2 | 2 4 3 | 3 5 4 | 1 2 5 | 4 1 6 | -------------------------------------------------------------------------------- /Problems/P2871/input: -------------------------------------------------------------------------------- 1 | 4 6 2 | 1 4 3 | 2 6 4 | 3 12 5 | 2 7 6 | -------------------------------------------------------------------------------- /Problems/P3071/in: -------------------------------------------------------------------------------- 1 | 10 4 2 | A 6 3 | L 2 4 4 | A 5 5 | A 2 6 | -------------------------------------------------------------------------------- /Problems/P3919/output: -------------------------------------------------------------------------------- 1 | 59 2 | 87 3 | 41 4 | 87 5 | 88 6 | 46 7 | -------------------------------------------------------------------------------- /Problems/P4095/output: -------------------------------------------------------------------------------- 1 | 13 2 | 11 3 | 6 4 | 12 5 | 4 6 | -------------------------------------------------------------------------------- /Problems/P1438/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | 1 2 3 4 5 3 | 1 2 4 1 2 4 | 2 3 5 | -------------------------------------------------------------------------------- /Problems/P1450/in: -------------------------------------------------------------------------------- 1 | 1 2 5 10 2 2 | 3 2 3 1 10 3 | 1000 2 2 2 900 4 | -------------------------------------------------------------------------------- /Problems/P1533/input: -------------------------------------------------------------------------------- 1 | 7 2 2 | 1 5 2 6 3 7 4 3 | 1 5 3 4 | 2 7 1 5 | -------------------------------------------------------------------------------- /Problems/P1757/input: -------------------------------------------------------------------------------- 1 | 45 3 2 | 10 10 1 3 | 10 5 1 4 | 50 400 2 5 | -------------------------------------------------------------------------------- /Problems/P1910/input: -------------------------------------------------------------------------------- 1 | 3 10 12 2 | 10 1 11 3 | 1 9 1 4 | 7 10 12 5 | -------------------------------------------------------------------------------- /Problems/P2746/input: -------------------------------------------------------------------------------- 1 | 5 2 | 2 4 3 0 3 | 4 5 0 4 | 0 5 | 0 6 | 1 0 7 | -------------------------------------------------------------------------------- /Problems/P7925/in: -------------------------------------------------------------------------------- 1 | 8 5 2 | 1 1 2 2 3 3 4 3 | -2 -6 1 -7 8 1 1 6 4 | -------------------------------------------------------------------------------- /Problems/P1049/input: -------------------------------------------------------------------------------- 1 | 24 2 | 6 3 | 8 4 | 3 5 | 12 6 | 7 7 | 9 8 | 7 9 | -------------------------------------------------------------------------------- /Problems/P1198/input: -------------------------------------------------------------------------------- 1 | 5 100 2 | A 96 3 | Q 1 4 | A 97 5 | Q 1 6 | Q 2 7 | -------------------------------------------------------------------------------- /Problems/P1220/input: -------------------------------------------------------------------------------- 1 | 5 3 2 | 2 10 3 | 3 20 4 | 5 20 5 | 6 30 6 | 8 10 7 | -------------------------------------------------------------------------------- /Problems/P1972/input: -------------------------------------------------------------------------------- 1 | 6 2 | 1 2 3 4 3 5 3 | 3 4 | 1 2 5 | 3 5 6 | 2 6 7 | -------------------------------------------------------------------------------- /Problems/P1973/input: -------------------------------------------------------------------------------- 1 | 5 2 | 8 2 3 | 1 5 4 | 5 3 5 | 3 2 6 | 5 3 7 | -------------------------------------------------------------------------------- /Problems/P2015/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | 1 3 1 3 | 1 4 10 4 | 2 3 20 5 | 3 5 20 6 | -------------------------------------------------------------------------------- /Problems/P2068/input: -------------------------------------------------------------------------------- 1 | 5 2 | 4 3 | x 3 8 4 | y 1 3 5 | x 4 9 6 | y 3 4 7 | -------------------------------------------------------------------------------- /Problems/P2690/input: -------------------------------------------------------------------------------- 1 | 7 2 2 | 2 3 | 1 4 | 1 5 | 2 6 | 2 7 | 1 8 | 1 9 | -------------------------------------------------------------------------------- /Problems/P2704/input: -------------------------------------------------------------------------------- 1 | 5 4 2 | PHPP 3 | PPHH 4 | PPPP 5 | PHPP 6 | PHHP 7 | -------------------------------------------------------------------------------- /Problems/P3195/input: -------------------------------------------------------------------------------- 1 | 7 5 2 | 3 3 | 1 4 | 5 5 | 2 6 | 2 7 | 1 8 | 4 9 | -------------------------------------------------------------------------------- /Problems/P3800/input: -------------------------------------------------------------------------------- 1 | 3 3 4 1 2 | 1 1 3 3 | 1 2 1 4 | 2 2 3 5 | 3 3 3 6 | -------------------------------------------------------------------------------- /Problems/P5994/in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 4 5 3 | 4 3 2 1 4 | 3 4 5 5 | 2 1 6 | 5 7 | -------------------------------------------------------------------------------- /Problems/P1107/input: -------------------------------------------------------------------------------- 1 | 3 10 2 2 | 3 1 4 10 3 | 6 3 5 9 7 8 9 4 | 5 4 5 3 6 9 5 | -------------------------------------------------------------------------------- /Problems/P1280/in: -------------------------------------------------------------------------------- 1 | 15 6 2 | 1 2 3 | 1 6 4 | 4 11 5 | 8 5 6 | 8 1 7 | 11 5 8 | -------------------------------------------------------------------------------- /Problems/P1356/input: -------------------------------------------------------------------------------- 1 | 2 2 | 4 7 3 | 17 5 -21 15 4 | 4 5 5 | 17 5 -21 15 6 | -------------------------------------------------------------------------------- /Problems/P1453/input: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 1 5 3 | 0 1 4 | 0 2 5 | 1 2 6 | 1 3 7 | 2 8 | -------------------------------------------------------------------------------- /Problems/P1483/in: -------------------------------------------------------------------------------- 1 | 5 4 2 | 6 9 9 8 1 3 | 2 4 4 | 1 2 5 5 | 1 3 1 6 | 2 4 7 | -------------------------------------------------------------------------------- /Problems/P1509/input: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 5 3 | 2 1 6 4 | 2 2 2 5 | 2 2 3 6 | 5 5 7 | -------------------------------------------------------------------------------- /Problems/P1558/input: -------------------------------------------------------------------------------- 1 | 2 2 4 2 | C 1 1 2 3 | P 1 2 4 | C 2 2 2 5 | P 1 2 6 | -------------------------------------------------------------------------------- /Problems/P1712/input: -------------------------------------------------------------------------------- 1 | 6 3 2 | 3 5 3 | 1 2 4 | 3 4 5 | 2 2 6 | 1 5 7 | 1 4 8 | -------------------------------------------------------------------------------- /Problems/P1759/input: -------------------------------------------------------------------------------- 1 | 100 100 3 2 | 50 60 289 3 | 40 10 116 4 | 50 50 106 5 | -------------------------------------------------------------------------------- /Problems/P1776/二进制拆分/input: -------------------------------------------------------------------------------- 1 | 4 20 2 | 3 9 3 3 | 5 9 1 4 | 9 4 2 5 | 8 1 3 6 | -------------------------------------------------------------------------------- /Problems/P1776/单调队列/input: -------------------------------------------------------------------------------- 1 | 4 20 2 | 3 9 3 3 | 5 9 1 4 | 9 4 2 5 | 8 1 3 6 | -------------------------------------------------------------------------------- /Problems/P2722/input: -------------------------------------------------------------------------------- 1 | 300 4 2 | 100 60 3 | 250 120 4 | 120 100 5 | 35 20 6 | -------------------------------------------------------------------------------- /Problems/P2889/input: -------------------------------------------------------------------------------- 1 | 12 4 2 2 | 1 2 8 3 | 10 12 19 4 | 3 6 24 5 | 7 10 31 6 | -------------------------------------------------------------------------------- /Problems/P1060/input: -------------------------------------------------------------------------------- 1 | 1000 5 2 | 800 2 3 | 400 5 4 | 300 5 5 | 400 3 6 | 200 2 7 | -------------------------------------------------------------------------------- /Problems/P1529/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(P1529) 2 | add_executable(P1529 P1529.c) 3 | -------------------------------------------------------------------------------- /Problems/P2824/input: -------------------------------------------------------------------------------- 1 | 6 3 2 | 1 6 2 5 3 4 3 | 0 1 4 4 | 1 3 6 5 | 0 2 4 6 | 3 7 | -------------------------------------------------------------------------------- /Problems/P4868/input: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1 2 3 4 5 3 | Query 5 4 | Modify 3 2 5 | Query 5 6 | -------------------------------------------------------------------------------- /Problems/P5958/in: -------------------------------------------------------------------------------- 1 | 9 3 2 | 1 3 | 1 4 | 2 5 | 2 6 | 2 7 | 3 8 | 7 9 | 3 10 | -------------------------------------------------------------------------------- /Problems/P1343/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(P1343) 2 | add_executable(P1343 P1343.cpp) 3 | -------------------------------------------------------------------------------- /Problems/P1854/input: -------------------------------------------------------------------------------- 1 | 3 5 2 | 7 23 -5 -24 16 3 | 5 21 -4 10 23 4 | -21 5 -4 -20 20 5 | -------------------------------------------------------------------------------- /Problems/P3376/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(P3376) 2 | add_executable(P3376 P3376.cpp) 3 | -------------------------------------------------------------------------------- /Problems/P3377/in: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 5 4 2 3 3 | 1 1 5 4 | 1 2 5 5 | 2 2 6 | 1 4 2 7 | 2 2 8 | -------------------------------------------------------------------------------- /Problems/P1736/input: -------------------------------------------------------------------------------- 1 | 4 6 2 | 0 1 0 1 0 0 3 | 0 0 1 0 1 0 4 | 1 1 0 0 0 1 5 | 0 1 1 0 1 0 6 | -------------------------------------------------------------------------------- /Problems/P1987/in: -------------------------------------------------------------------------------- 1 | 3 3 2 | 10 20 30 3 | 4 5 6 4 | 4 3 5 | 20 30 40 50 6 | 2 7 6 5 7 | 0 0 8 | -------------------------------------------------------------------------------- /Problems/P2014/input: -------------------------------------------------------------------------------- 1 | 7 4 2 | 2 2 3 | 0 1 4 | 0 4 5 | 2 1 6 | 7 1 7 | 7 6 8 | 2 2 9 | -------------------------------------------------------------------------------- /Problems/P3381/in: -------------------------------------------------------------------------------- 1 | 4 5 4 3 2 | 4 2 30 2 3 | 4 3 20 3 4 | 2 3 20 1 5 | 2 1 30 9 6 | 1 3 40 5 -------------------------------------------------------------------------------- /Problems/P3810/out: -------------------------------------------------------------------------------- 1 | 2 2 | 0 3 | 0 4 | 5 5 | 1 6 | 1 7 | 0 8 | 0 9 | 0 10 | 1 11 | -------------------------------------------------------------------------------- /Problems/P4014/in: -------------------------------------------------------------------------------- 1 | 5 2 | 2 2 2 1 2 3 | 2 3 1 2 4 4 | 2 0 1 1 1 5 | 2 3 4 3 3 6 | 3 2 1 2 1 7 | -------------------------------------------------------------------------------- /Problems/P1122/input: -------------------------------------------------------------------------------- 1 | 7 2 | -1 -1 -1 1 1 1 0 3 | 1 4 4 | 2 5 5 | 3 6 6 | 4 7 7 | 5 7 8 | 6 7 9 | -------------------------------------------------------------------------------- /Problems/P1507/input: -------------------------------------------------------------------------------- 1 | 320 350 2 | 4 3 | 160 40 120 4 | 80 110 240 5 | 220 70 310 6 | 40 400 220 7 | -------------------------------------------------------------------------------- /Problems/P1723/in: -------------------------------------------------------------------------------- 1 | 5 2 | aaabaac 3 | bbbbaccaijk 4 | bbbaccabiiij 5 | abcd 6 | hhijkkklloonoonk 7 | -------------------------------------------------------------------------------- /Problems/P2068/P2068.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2068/P2068.c -------------------------------------------------------------------------------- /Problems/P2073/P2073.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2073/P2073.c -------------------------------------------------------------------------------- /Problems/P3372/input: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 5 4 2 3 3 | 2 2 4 4 | 1 2 3 2 5 | 2 3 4 6 | 1 1 5 1 7 | 2 1 4 8 | -------------------------------------------------------------------------------- /Problems/P3373/P3373.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3373/P3373.c -------------------------------------------------------------------------------- /Problems/P4552/P4552.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4552/P4552.c -------------------------------------------------------------------------------- /Problems/P5018/P5018.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P5018/P5018.c -------------------------------------------------------------------------------- /Problems/P1027/P1027.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1027/P1027.cpp -------------------------------------------------------------------------------- /Problems/P1186/P1186.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1186/P1186.cpp -------------------------------------------------------------------------------- /Problems/P1330/C/P1330.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1330/C/P1330.c -------------------------------------------------------------------------------- /Problems/P1342/P1342.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1342/P1342.cpp -------------------------------------------------------------------------------- /Problems/P1347/P1347.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1347/P1347.cpp -------------------------------------------------------------------------------- /Problems/P1428/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1428/README.md -------------------------------------------------------------------------------- /Problems/P1462/P1462.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1462/P1462.cpp -------------------------------------------------------------------------------- /Problems/P1486/P1486.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1486/P1486.cpp -------------------------------------------------------------------------------- /Problems/P1491/P1491.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1491/P1491.cpp -------------------------------------------------------------------------------- /Problems/P1550/P1550.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1550/P1550.cpp -------------------------------------------------------------------------------- /Problems/P1576/P1576.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1576/P1576.cpp -------------------------------------------------------------------------------- /Problems/P1608/P1608.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1608/P1608.cpp -------------------------------------------------------------------------------- /Problems/P1629/P1629.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1629/P1629.cpp -------------------------------------------------------------------------------- /Problems/P1802/input: -------------------------------------------------------------------------------- 1 | 6 8 2 | 21 52 1 3 | 21 70 5 4 | 21 48 2 5 | 14 38 3 6 | 14 36 1 7 | 14 36 2 8 | -------------------------------------------------------------------------------- /Problems/P1841/P1841.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1841/P1841.cpp -------------------------------------------------------------------------------- /Problems/P1951/P1951.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1951/P1951.cpp -------------------------------------------------------------------------------- /Problems/P2055/P2055.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2055/P2055.cpp -------------------------------------------------------------------------------- /Problems/P2169/P2169.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2169/P2169.cpp -------------------------------------------------------------------------------- /Problems/P2176/P2176.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2176/P2176.cpp -------------------------------------------------------------------------------- /Problems/P2756/P2756.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2756/P2756.cpp -------------------------------------------------------------------------------- /Problems/P2825/P2825.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2825/P2825.cpp -------------------------------------------------------------------------------- /Problems/P2829/P2829.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2829/P2829.cpp -------------------------------------------------------------------------------- /Problems/P2865/P2865.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2865/P2865.cpp -------------------------------------------------------------------------------- /Problems/P2880/input: -------------------------------------------------------------------------------- 1 | 6 3 2 | 1 3 | 7 4 | 3 5 | 4 6 | 2 7 | 5 8 | 1 5 9 | 4 6 10 | 2 2 11 | -------------------------------------------------------------------------------- /Problems/P2939/P2939.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2939/P2939.cpp -------------------------------------------------------------------------------- /Problems/P3003/P3003.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3003/P3003.cpp -------------------------------------------------------------------------------- /Problems/P3366/P3366.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3366/P3366.cpp -------------------------------------------------------------------------------- /Problems/P3369/P3369.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3369/P3369.cpp -------------------------------------------------------------------------------- /Problems/P3373/input: -------------------------------------------------------------------------------- 1 | 5 5 38 2 | 1 5 4 2 3 3 | 2 1 4 1 4 | 3 2 5 5 | 1 2 4 2 6 | 2 3 5 5 7 | 3 1 4 8 | -------------------------------------------------------------------------------- /Problems/P3376/P3376.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3376/P3376.cpp -------------------------------------------------------------------------------- /Problems/P3386/P3386.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3386/P3386.cpp -------------------------------------------------------------------------------- /Problems/P3393/P3393.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3393/P3393.cpp -------------------------------------------------------------------------------- /Problems/P3871/P3871.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3871/P3871.cpp -------------------------------------------------------------------------------- /Problems/P3915/input: -------------------------------------------------------------------------------- 1 | 2 2 | 4 2 3 | 1 2 4 | 2 3 5 | 3 4 6 | 4 2 7 | 1 2 8 | 1 3 9 | 1 4 10 | -------------------------------------------------------------------------------- /Problems/P4480/P4480.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4480/P4480.cpp -------------------------------------------------------------------------------- /Problems/P4554/P4554.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4554/P4554.cpp -------------------------------------------------------------------------------- /Problems/P4568/P4568.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4568/P4568.cpp -------------------------------------------------------------------------------- /Problems/P4943/P4943.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4943/P4943.cpp -------------------------------------------------------------------------------- /Problems/U138763/input: -------------------------------------------------------------------------------- 1 | 5 2 2 | 3 3 | 1 1 4 | 2 1 5 | 5 3 6 | 3 7 | 2 1 8 | 3 2 9 | 4 1 10 | -------------------------------------------------------------------------------- /Problems/P1027/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1027/Solution.md -------------------------------------------------------------------------------- /Problems/P1168/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1168/Solution.md -------------------------------------------------------------------------------- /Problems/P1186/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1186/Solution.md -------------------------------------------------------------------------------- /Problems/P1330/C++/P1330.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1330/C++/P1330.cpp -------------------------------------------------------------------------------- /Problems/P1330/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1330/Solution.md -------------------------------------------------------------------------------- /Problems/P1342/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1342/Solution.md -------------------------------------------------------------------------------- /Problems/P1347/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1347/Solution.md -------------------------------------------------------------------------------- /Problems/P1428/SBT/P1428.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1428/SBT/P1428.c -------------------------------------------------------------------------------- /Problems/P1428/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1428/Solution.md -------------------------------------------------------------------------------- /Problems/P1438/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1438/Solution.md -------------------------------------------------------------------------------- /Problems/P1462/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1462/Solution.md -------------------------------------------------------------------------------- /Problems/P1491/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1491/Solution.md -------------------------------------------------------------------------------- /Problems/P1550/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1550/Solution.md -------------------------------------------------------------------------------- /Problems/P1576/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1576/Solution.md -------------------------------------------------------------------------------- /Problems/P1629/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1629/Solution.md -------------------------------------------------------------------------------- /Problems/P1841/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1841/Solution.md -------------------------------------------------------------------------------- /Problems/P1951/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P1951/Solution.md -------------------------------------------------------------------------------- /Problems/P2023/input: -------------------------------------------------------------------------------- 1 | 7 43 2 | 1 2 3 4 5 6 7 3 | 5 4 | 1 2 5 5 5 | 3 2 4 6 | 2 3 7 9 7 | 3 1 3 8 | 3 4 7 9 | -------------------------------------------------------------------------------- /Problems/P2055/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2055/Solution.md -------------------------------------------------------------------------------- /Problems/P2073/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2073/Solution.md -------------------------------------------------------------------------------- /Problems/P2161/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2161/Solution.md -------------------------------------------------------------------------------- /Problems/P2169/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2169/Solution.md -------------------------------------------------------------------------------- /Problems/P2176/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2176/Solution.md -------------------------------------------------------------------------------- /Problems/P2343/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2343/Solution.md -------------------------------------------------------------------------------- /Problems/P2417/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2417/Solution.md -------------------------------------------------------------------------------- /Problems/P2574/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2574/Solution.md -------------------------------------------------------------------------------- /Problems/P2574/input: -------------------------------------------------------------------------------- 1 | 10 6 2 | 1011101001 3 | 0 2 4 4 | 1 1 5 5 | 0 3 7 6 | 1 1 10 7 | 0 1 4 8 | 1 2 6 9 | -------------------------------------------------------------------------------- /Problems/P2756/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2756/Solution.md -------------------------------------------------------------------------------- /Problems/P2825/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2825/Solution.md -------------------------------------------------------------------------------- /Problems/P2829/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2829/Solution.md -------------------------------------------------------------------------------- /Problems/P2865/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2865/Solution.md -------------------------------------------------------------------------------- /Problems/P2939/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P2939/Solution.md -------------------------------------------------------------------------------- /Problems/P3368/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P3368 3 | 4 | $(TARGET) : P3368.c 5 | $(CC) -o $@ $< 6 | -------------------------------------------------------------------------------- /Problems/P3372/BIT/P3372.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3372/BIT/P3372.c -------------------------------------------------------------------------------- /Problems/P3373/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3373/Solution.md -------------------------------------------------------------------------------- /Problems/P3374/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P3374 3 | 4 | $(TARGET) : P3374.c 5 | $(CC) -o $@ $< 6 | -------------------------------------------------------------------------------- /Problems/P3386/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3386/Solution.md -------------------------------------------------------------------------------- /Problems/P3393/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3393/Solution.md -------------------------------------------------------------------------------- /Problems/P3871/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3871/Solution.md -------------------------------------------------------------------------------- /Problems/P3946/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P3946/Solution.md -------------------------------------------------------------------------------- /Problems/P4552/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4552/Solution.md -------------------------------------------------------------------------------- /Problems/P4554/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4554/Solution.md -------------------------------------------------------------------------------- /Problems/P4568/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4568/Solution.md -------------------------------------------------------------------------------- /Problems/P4868/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4868/Solution.md -------------------------------------------------------------------------------- /Problems/P4943/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P4943/Solution.md -------------------------------------------------------------------------------- /Problems/P5018/Solution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrykcode/luogu/HEAD/Problems/P5018/Solution.md -------------------------------------------------------------------------------- /Problems/P3379/in: -------------------------------------------------------------------------------- 1 | 5 5 4 2 | 3 1 3 | 2 4 4 | 5 1 5 | 1 4 6 | 2 4 7 | 3 2 8 | 3 5 9 | 1 2 10 | 4 5 11 | -------------------------------------------------------------------------------- /Problems/P4362/in: -------------------------------------------------------------------------------- 1 | 8 2 4 2 | 1 2 20 3 | 1 3 4 4 | 1 4 13 5 | 2 5 10 6 | 2 6 12 7 | 3 7 15 8 | 3 8 5 9 | -------------------------------------------------------------------------------- /Problems/P1330/C/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P1330 3 | 4 | $(TARGET) : P1330.c 5 | $(CC) -o $(TARGET) P1330.c 6 | -------------------------------------------------------------------------------- /Problems/P1491/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1491 3 | 4 | $(TARGET) : P1491 5 | $(CC) -o $(TARGET) P1491.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1529/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P1529 3 | 4 | $(TARGET) : P1529.c 5 | $(CC) -o $(TARGET) P1529.c 6 | -------------------------------------------------------------------------------- /Problems/P1558/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1558) 3 | add_executable(P1558 P1558.c) -------------------------------------------------------------------------------- /Problems/P2073/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P2073 3 | 4 | $(TARGET) : P2073.c 5 | $(CC) -o $(TARGET) P2073.c 6 | -------------------------------------------------------------------------------- /Problems/P2161/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P2161 3 | 4 | $(TARGET) : P2161.c 5 | $(CC) -o $(TARGET) P2161.c 6 | -------------------------------------------------------------------------------- /Problems/P2343/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P2343 3 | 4 | $(TARGET) : P2343.c 5 | $(CC) -o $(TARGET) P2343.c 6 | -------------------------------------------------------------------------------- /Problems/P2574/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2574) 3 | add_executable(P2574 P2574.c) -------------------------------------------------------------------------------- /Problems/P5018/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | TARGET = P5018 3 | 4 | $(TARGET) : P5018.c 5 | $(CC) -o $(TARGET) P5018.c 6 | -------------------------------------------------------------------------------- /Problems/P1027/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1027 3 | 4 | $(TARGET) : P1027.cpp 5 | $(CC) -o $(TARGET) P1027.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1048/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1048) 3 | add_executable(P1048 P1048.c) 4 | -------------------------------------------------------------------------------- /Problems/P1060/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1060) 3 | add_executable(P1060 P1060.c) 4 | -------------------------------------------------------------------------------- /Problems/P1110/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1110 3 | 4 | $(TARGET) : P1110.cpp 5 | $(CC) -o $(TARGET) P1110.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1129/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1129 3 | 4 | $(TARGET) : P1129.cpp 5 | $(CC) -o $(TARGET) P1129.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1168/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1168) 3 | add_executable(P1168 P1168.cc) 4 | -------------------------------------------------------------------------------- /Problems/P1186/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1186 3 | 4 | $(TARGET) : P1186.cpp 5 | $(CC) -o $(TARGET) P1186.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1198/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1198) 3 | add_executable(P1198 P1198.c) 4 | -------------------------------------------------------------------------------- /Problems/P1342/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1342 3 | 4 | $(TARGET) : P1342.cpp 5 | $(CC) -o $(TARGET) P1342.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1343/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1343 3 | 4 | $(TARGET) : P1343.cpp 5 | $(CC) -o $(TARGET) P1343.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1347/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1347 3 | 4 | $(TARGET) : P1347.cpp 5 | $(CC) -o $(TARGET) P1347.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1438/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1438) 3 | add_executable(P1438 P1438.c) 4 | -------------------------------------------------------------------------------- /Problems/P1462/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1462 3 | 4 | $(TARGET) : P1462.cpp 5 | $(CC) -o $(TARGET) P1462.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1486/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1486 3 | 4 | $(TARGET) : P1486.cpp 5 | $(CC) -o $(TARGET) P1486.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1550/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1550 3 | 4 | $(TARGET) : P1550.cpp 5 | $(CC) -o $(TARGET) P1550.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1576/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1576 3 | 4 | $(TARGET) : P1576.cpp 5 | $(CC) -o $(TARGET) P1576.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1608/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1608 3 | 4 | $(TARGET) : P1608.cpp 5 | $(CC) -o $(TARGET) P1608.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1629/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1629 3 | 4 | $(TARGET) : P1629.cpp 5 | $(CC) -o $(TARGET) P1629.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1712/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1712) 3 | add_executable(P1712 P1712.c) 4 | -------------------------------------------------------------------------------- /Problems/P1726/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1726 3 | 4 | $(TARGET) : P1726.cpp 5 | $(CC) -o $(TARGET) P1726.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1801/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1801) 3 | add_executable(P1801 P1801.cc) 4 | -------------------------------------------------------------------------------- /Problems/P1841/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1841 3 | 4 | $(TARGET) : P1841.cpp 5 | $(CC) -o $(TARGET) P1841.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1894/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1894 3 | 4 | $(TARGET) : P1894.cpp 5 | $(CC) -o $(TARGET) P1894.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1951/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1951 3 | 4 | $(TAREGT) : P1951.cpp 5 | $(CC) -o $(TARGET) P1951.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1972/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1972) 3 | add_executable(P1972 P1972.c) 4 | -------------------------------------------------------------------------------- /Problems/P1983/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1983 3 | 4 | $(TARGET) : P1983.cpp 5 | $(CC) -o $(TARGET) P1983.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2023/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2023) 3 | add_executable(P2023 P2023.c) 4 | -------------------------------------------------------------------------------- /Problems/P2055/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2055 3 | 4 | $(TARGET) : P2055.cpp 5 | $(CC) -o $(TARGET) P2055.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2068/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2068) 3 | add_executable(P2068 P2068.c) 4 | -------------------------------------------------------------------------------- /Problems/P2071/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2071 3 | 4 | $(TARGET) : P2071.cpp 5 | $(CC) -o $(TARGET) P2071.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2073/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2073) 3 | add_executable(P2073 P2073.c) 4 | -------------------------------------------------------------------------------- /Problems/P2161/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2161) 3 | add_executable(P2161 P2161.c) 4 | -------------------------------------------------------------------------------- /Problems/P2169/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2169 3 | 4 | $(TARGET) : P2169.cpp 5 | $(CC) -o $(TARGET) P2169.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2176/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2176 3 | 4 | $(TARGET) : P2176.cpp 5 | $(CC) -o $(TARGET) P2176.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2319/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2319 3 | 4 | $(TARGET) : P2319.cpp 5 | $(CC) -o $(TARGET) P2319.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2343/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2343) 3 | add_executable(P2343 P2343.c) 4 | -------------------------------------------------------------------------------- /Problems/P2417/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2417 3 | 4 | $(TARGET) : P2417.cpp 5 | $(CC) -o $(TARGET) P2417.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2683/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2683 3 | 4 | $(TARGET) : P2683.cpp 5 | $(CC) -o $(TARGET) P2683.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2756/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2756 3 | 4 | $(TARGET) : P2756.cpp 5 | $(CC) -o $(TARGET) P2756.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2825/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2825 3 | 4 | $(TARGET) : P2825.cpp 5 | $(CC) -o $(TARGET) P2825.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2829/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2829 3 | 4 | $(TARGET) : P2829.cpp 5 | $(CC) -o $(TARGET) P2829.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2865/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2865 3 | 4 | $(TARGET) : P2865.cpp 5 | $(CC) -o $(TARGET) P2865.cpp 6 | -------------------------------------------------------------------------------- /Problems/P2880/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2880) 3 | add_executable(P2880 P2880.c) 4 | -------------------------------------------------------------------------------- /Problems/P2939/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P2939 3 | 4 | $(TARGET) : P2939.cpp 5 | $(CC) -o $(TARGET) P2939.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3003/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3003 3 | 4 | $(TARGET) : P3003.cpp 5 | $(CC) -o $(TARGET) P3003.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3366/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3366 3 | 4 | $(TARGET) : P3366.cpp 5 | $(CC) -o $(TARGET) P3366.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3368/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3368) 3 | add_executable(P3368 P3368.c) 4 | -------------------------------------------------------------------------------- /Problems/P3369/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3369 3 | 4 | $(TARGET) : P3369.cpp 5 | $(CC) -o $(TARGET) P3369.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3373/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3373) 3 | add_executable(P3373 P3373.c) 4 | -------------------------------------------------------------------------------- /Problems/P3374/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3374) 3 | add_executable(P3374 P3374.c) 4 | -------------------------------------------------------------------------------- /Problems/P3376/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3376 3 | 4 | $(TARGET) : P3376.cpp 5 | $(CC) -o $(TARGET) P3376.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3386/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3386 3 | 4 | $(TARGET) : P3386.cpp 5 | $(CC) -o $(TARGET) P3386.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3393/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3393 3 | 4 | $(TARGET) : P3393.cpp 5 | $(CC) -o $(TARGET) P3393.cpp 6 | -------------------------------------------------------------------------------- /Problems/P3946/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P3946 3 | 4 | $(TARGET) : P3946.cpp 5 | $(CC) -o $(TARGET) P3946.cpp 6 | -------------------------------------------------------------------------------- /Problems/P4480/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P4480 3 | 4 | $(TARGET) : P4480.cpp 5 | $(CC) -o $(TARGET) P4480.cpp 6 | -------------------------------------------------------------------------------- /Problems/P4552/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P4552) 3 | add_executable(P4552 P4552.c) 4 | -------------------------------------------------------------------------------- /Problems/P4554/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P4554 3 | 4 | $(TARGET) : P4554.cpp 5 | $(CC) -o $(TARGET) P4554.cpp 6 | -------------------------------------------------------------------------------- /Problems/P4568/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P4568 3 | 4 | $(TARGET) : P4568.cpp 5 | $(CC) -o $(TARGET) P4568.cpp 6 | -------------------------------------------------------------------------------- /Problems/P4868/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P4868) 3 | add_executable(P4868 P4868.cc) 4 | -------------------------------------------------------------------------------- /Problems/P4879/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P4879) 3 | add_executable(P4879 P4879.c) 4 | -------------------------------------------------------------------------------- /Problems/P4943/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P4943 3 | 4 | $(TARGET) : P4943.cpp 5 | $(CC) -o $(TARGET) P4943.cpp 6 | -------------------------------------------------------------------------------- /Problems/P5018/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P5018) 3 | add_executable(P5018 P5018.c) 4 | -------------------------------------------------------------------------------- /Problems/P1027/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1027) 3 | add_executable(P1027 P1027.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1110/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1110) 3 | add_executable(P1110 P1110.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1129/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1129) 3 | add_executable(P1129 P1129.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1186/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1186) 3 | add_executable(P1186 P1186.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1330/C++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1330) 3 | add_executable(P1330 P1330.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1330/C++/makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | TARGET = P1330 3 | 4 | $(TARGET) : P1330.cpp 5 | $(CC) -o $(TARGET) P1330.cpp 6 | -------------------------------------------------------------------------------- /Problems/P1330/C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1330) 3 | add_executable(P1330 P1330.c) 4 | -------------------------------------------------------------------------------- /Problems/P1342/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1342) 3 | add_executable(P1342 P1342.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1347/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1347) 3 | add_executable(P1347 P1347.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1428/BIT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1428) 3 | add_executable(P1428 P1428.c) 4 | -------------------------------------------------------------------------------- /Problems/P1428/SBT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1428) 3 | add_executable(P1428 P1428.c) 4 | -------------------------------------------------------------------------------- /Problems/P1462/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1462) 3 | add_executable(P1462 P1462.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1486/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1486) 3 | add_executable(P1486 P1486.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1491/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1491) 3 | add_executable(P1491 P1491.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1550/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1550) 3 | add_executable(P1550 P1550.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1576/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1576) 3 | add_executable(P1576 P1576.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1608/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1608) 3 | add_executable(P1608 P1608.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1629/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1629) 3 | add_executable(P1629 P1629.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1726/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1726) 3 | add_executable(P1726 P1726.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1841/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1841) 3 | add_executable(P1841 P1841.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1879/input: -------------------------------------------------------------------------------- 1 | 4 10 2 | 0 1 1 1 1 1 1 1 1 1 3 | 1 1 1 0 1 1 1 1 1 1 4 | 1 1 1 1 1 1 0 1 1 1 5 | 0 0 1 1 1 1 1 1 1 0 6 | -------------------------------------------------------------------------------- /Problems/P1894/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1894) 3 | add_executable(P1894 P1894.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1951/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P1951) 3 | add_executable(P1951 P1951.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1983/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P1983) 3 | add_executable(P1983 P1983.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2055/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2055) 3 | add_executable(P2055 P2055.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2071/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2071) 3 | add_executable(P2071 P2071.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2169/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P2169) 3 | add_executable(P2169 P2169.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2176/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P2176) 3 | add_executable(P2176 P2176.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2319/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2319) 3 | add_executable(P2319 P2319.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2417/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2417) 3 | add_executable(P2417 P2417.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2683/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P2683) 3 | add_executable(P2683 P2683.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2756/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2756) 3 | add_executable(P2756 P2756.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2825/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2825) 3 | add_executable(P2825 P2825.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2829/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P2829) 3 | add_executable(P2829 P2829.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2865/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P2865) 3 | add_executable(P2865 P2865.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P2939/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P2939) 3 | add_executable(P2939 P2939.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3003/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3003) 3 | add_executable(P3003 P3003.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3366/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P3366) 3 | add_executable(P3366 P3366.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3369/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3369) 3 | add_executable(P3369 P3369.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3372/BIT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3372) 3 | add_executable(P3372 P3372.c) 4 | -------------------------------------------------------------------------------- /Problems/P3386/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3386) 3 | add_executable(P3386 P3386.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3393/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P3393) 3 | add_executable(P3393 P3393.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3871/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3871) 3 | add_executable(P3871 P3871.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P3946/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P3946) 3 | add_executable(P3946 P3946.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P4480/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P4480) 3 | add_executable(P4480 P4480.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P4554/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P4554) 3 | add_executable(P4554 P4554.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P4568/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.4) 2 | project(P4568) 3 | add_executable(P4568 P4568.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P4943/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P4943) 3 | add_executable(P4943 P4943.cpp) 4 | -------------------------------------------------------------------------------- /Problems/P1536/in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 1 3 3 | 4 3 4 | 3 3 5 | 1 2 6 | 1 3 7 | 2 3 8 | 5 2 9 | 1 2 10 | 3 5 11 | 999 0 12 | 0 -------------------------------------------------------------------------------- /Problems/P1802/Warning.md: -------------------------------------------------------------------------------- 1 | 输了也拿经验, 开始看成输了要罚掉经验, 结果样例都过不了, 看了题解才如梦惊醒[题解](https://www.luogu.com.cn/blog/ShanXian/solution-p1802#) 2 | -------------------------------------------------------------------------------- /Problems/P3372/SegmentTree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(P3372) 3 | add_executable(P3372 P3372.c) 4 | -------------------------------------------------------------------------------- /Problems/P4879/input: -------------------------------------------------------------------------------- 1 | 5 10 2 | 1 2 3 4 5 3 | Q 4 | C 3 2 5 | Q 6 | I 6 6 7 | Q 8 | D 4 9 | Q 10 | C 5 2 11 | I 7 9 12 | Q 13 | -------------------------------------------------------------------------------- /Problems/P1352/input: -------------------------------------------------------------------------------- 1 | 7 2 | 1 3 | 1 4 | 1 5 | 1 6 | 1 7 | 1 8 | 1 9 | 1 3 10 | 2 3 11 | 6 4 12 | 7 4 13 | 4 5 14 | 3 5 15 | 0 0 16 | -------------------------------------------------------------------------------- /Problems/P1508/in: -------------------------------------------------------------------------------- 1 | 6 7 2 | 16 4 3 12 6 0 3 3 | 4 -5 6 7 0 0 2 4 | 6 0 -1 -2 3 6 8 5 | 5 3 4 0 0 -2 7 6 | -1 7 4 0 7 -5 6 7 | 0 -1 3 4 12 4 2 8 | -------------------------------------------------------------------------------- /Problems/P3384/in: -------------------------------------------------------------------------------- 1 | 5 5 2 24 2 | 7 3 7 8 0 3 | 1 2 4 | 1 5 5 | 3 1 6 | 4 1 7 | 3 4 2 8 | 3 2 2 9 | 4 5 10 | 1 5 1 3 11 | 2 1 3 12 | -------------------------------------------------------------------------------- /Problems/P2439/input: -------------------------------------------------------------------------------- 1 | 12 2 | 1 2 3 | 3 5 4 | 0 4 5 | 6 8 6 | 7 13 7 | 4 6 8 | 9 10 9 | 9 12 10 | 11 14 11 | 15 19 12 | 14 16 13 | 18 20 14 | -------------------------------------------------------------------------------- /Problems/P4095/input: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 4 3 | 1 2 1 4 | 4 1 2 5 | 2 1 1 6 | 3 2 3 7 | 5 8 | 1 10 9 | 2 7 10 | 3 4 11 | 4 8 12 | 0 5 13 | -------------------------------------------------------------------------------- /Problems/P1339/in: -------------------------------------------------------------------------------- 1 | 7 11 5 4 2 | 2 4 2 3 | 1 4 3 4 | 7 2 2 5 | 3 4 3 6 | 5 7 5 7 | 7 3 3 8 | 6 1 1 9 | 6 3 4 10 | 2 4 3 11 | 5 6 3 12 | 7 2 1 13 | -------------------------------------------------------------------------------- /Problems/P3810/in: -------------------------------------------------------------------------------- 1 | 10 3 2 | 2 3 3 3 | 3 2 2 4 | 3 3 3 5 | 3 2 1 6 | 2 2 1 7 | 1 2 2 8 | 3 2 1 9 | 2 2 3 10 | 2 2 3 11 | 3 2 1 12 | -------------------------------------------------------------------------------- /Problems/P2584/output: -------------------------------------------------------------------------------- 1 | 2 2 | CATHY TOM ADAM BOB 3 | CATHY LEO KAINE WALT MICK GRACE SANDY JACK TOM BOB 4 | WALT MICK GRACE SANDY JACK TOM BOB ADAM DAM 5 | 4 6 | -------------------------------------------------------------------------------- /Problems/P3919/input: -------------------------------------------------------------------------------- 1 | 5 10 2 | 59 46 14 87 41 3 | 0 2 1 4 | 0 1 1 14 5 | 0 1 1 57 6 | 0 1 1 88 7 | 4 2 4 8 | 0 2 5 9 | 0 2 4 10 | 4 2 1 11 | 2 2 2 12 | 1 1 5 91 13 | -------------------------------------------------------------------------------- /Problems/P2966/in: -------------------------------------------------------------------------------- 1 | 5 7 2 2 | 2 3 | 5 4 | 3 5 | 3 6 | 4 7 | 1 2 3 8 | 1 3 2 9 | 2 5 3 10 | 5 3 1 11 | 5 4 1 12 | 2 4 3 13 | 3 4 4 14 | 1 4 15 | 2 3 16 | -------------------------------------------------------------------------------- /Problems/P3408/in: -------------------------------------------------------------------------------- 1 | 14 5 3 2 | 0 3 3 | 0 3 4 | 1 10 5 | 1 10 6 | 2 3 7 | 2 10 8 | 2 3 9 | 5 10 10 | 7 10 11 | 5 10 12 | 7 10 13 | 5 10 14 | 7 10 15 | 5 10 -------------------------------------------------------------------------------- /Problems/P4722/in: -------------------------------------------------------------------------------- 1 | 7 14 1 7 2 | 1 2 5 3 | 1 3 6 4 | 1 4 5 5 | 2 3 2 6 | 2 5 3 7 | 3 2 2 8 | 3 4 3 9 | 3 5 3 10 | 3 6 7 11 | 4 6 5 12 | 5 6 1 13 | 6 5 1 14 | 5 7 8 15 | 6 7 7 -------------------------------------------------------------------------------- /Problems/P1944/input: -------------------------------------------------------------------------------- 1 | ]]]][][(((())]]]]]]][[]][[)[]]][][]()]]](]][))))(()]][[)[)(](][))(())(())]][[]])))))))[[(([]))]][]()()]]]]]()[[[[[]]]]]]]]]]]]]((((()))[[[]]][(([]))]()[]]]]]]()()[] 2 | -------------------------------------------------------------------------------- /Problems/P2170/Solution.md: -------------------------------------------------------------------------------- 1 | ### P2170 2 | 3 | [原题地址](https://www.luogu.com.cn/problem/P2170) 4 | 5 | 用并查集将实力相当的人连在一起, 对于一组实力相当的人, 他们要么全选, 要么全不选. 6 | 也就是并查集处理完k对人之后, 对于每个集合, 要么选其中所有人, 要么一个也不选. 7 | 即每个集合的人数, 如何组合最接近m. 8 | 问题转化为: 一组数, 求组成与m最接近的数. 9 | DP即可 10 | -------------------------------------------------------------------------------- /Problems/P2306/NOTICE.md: -------------------------------------------------------------------------------- 1 | 这道题一眼看去似乎只是个超级简单的01背包,但是再一看数据范围,n和m达到10万,那么O(nm)的算法必定超时。再仔细看,发现物品的体积和价值的数据范围非常小,所有不同的非零体积,价值的组合不过100种,所以可以把原来的10万个物品看成100种物品,每种物品有若干个(输入时计数),那么题目也就从10万个物品做01背包转化成对100种物品做多重背包,用单调队列优化一下,再特判一下体积或价值为0的情况,就AC了 2 | 3 | 参考: 4 | [数据太大 01背包会超时](https://www.luogu.com.cn/discuss/482559) 5 | [注意质量为0的情况!!!](https://www.luogu.com.cn/discuss/77472) 6 | -------------------------------------------------------------------------------- /Problems/P2584/input: -------------------------------------------------------------------------------- 1 | 20 2 | +ADAM 1000000 3 | +BOB 1000000 4 | +TOM 2000000 5 | +CATHY 10000000 6 | ?TOM 7 | ?1 8 | +DAM 100000 9 | +BOB 1200000 10 | +ADAM 900000 11 | +FRANK 12340000 12 | +LEO 9000000 13 | +KAINE 9000000 14 | +GRACE 8000000 15 | +WALT 9000000 16 | +SANDY 8000000 17 | +MICK 9000000 18 | +JACK 7320000 19 | ?2 20 | ?5 21 | ?KAINE 22 | -------------------------------------------------------------------------------- /Problems/P4933/input2: -------------------------------------------------------------------------------- 1 | 100 2 | 90 1004 171 99 1835 108 81 117 141 126 135 144 81 153 193 81 962 162 1493 171 1780 864 297 180 532 1781 189 1059 198 333 1593 824 207 1877 216 270 225 1131 336 1875 362 234 81 288 1550 243 463 1755 252 406 261 270 279 288 1393 261 1263 297 135 333 872 234 881 180 198 81 225 306 180 90 315 81 81 198 252 81 297 1336 1140 1238 81 198 297 661 81 1372 469 1132 81 126 324 333 342 81 351 481 279 1770 1225 549 3 | -------------------------------------------------------------------------------- /Problems/P1164/P1164.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define maxm 10000 5 | int dp[maxm + 1]; 6 | 7 | int main() { 8 | int n, m, a; 9 | fscanf(stdin, "%d %d", &n, &m); 10 | for (int i = 0; i < n; i++) { 11 | fscanf(stdin, "%d", &a); 12 | for (int j = m; j > a; j--) 13 | dp[j] += dp[j - a]; 14 | dp[a]++; 15 | } 16 | fprintf(stdout, "%d", dp[m]); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /Problems/P1168/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P1168.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P1168 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : 18 | $(CLEAN) 19 | 20 | CC = g++ 21 | $(TARGET) : P1168.cc 22 | $(CC) -o $@ $< 23 | -------------------------------------------------------------------------------- /Problems/P1018/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1018 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | LEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : 24 | $(CLEAN_CMD) $(TARGET) 25 | -------------------------------------------------------------------------------- /Problems/P1987/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1987 2 | 3 | ifeq ($(OS), Windows) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P4160/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4160 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run: $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | $(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1043/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1043 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run: $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1049/P1049.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int dp[20001]; 5 | 6 | int max(int a, int b) { 7 | return a > b ? a : b; 8 | } 9 | 10 | int main() { 11 | int v, n, vi; 12 | scanf("%d", &v); 13 | scanf("%d", &n); 14 | for (int i = 0; i < n; i++) { 15 | scanf("%d", &vi); 16 | for (int j = v; j >= vi; j--) 17 | dp[j] = max(dp[j], dp[j - vi] + vi); 18 | } 19 | printf("%d", v - dp[v]); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /Problems/P1077/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1077 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : in out $(TARGET) 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1169/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1169 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1233/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1233 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1282/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1282 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1536/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1536 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1717/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1717 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run: $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1857/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1857 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2134/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2134 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OS).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2187/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2187 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OS).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2408/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2408 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2647/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2647 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P3809/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3809 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P4868/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P4868.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P4868 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = g++ 21 | SRC = P4868.cc 22 | $(TARGET) : $(SRC) 23 | $(CC) -o $@ $< 24 | 25 | -------------------------------------------------------------------------------- /Problems/P5144/makefile: -------------------------------------------------------------------------------- 1 | OJ = P5144 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run: $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P5788/makefile: -------------------------------------------------------------------------------- 1 | OJ = P5788 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) in out 19 | $(RUN) < in > tmp_out 20 | -$(DIFF) tmp_out out 21 | $(CLEAN_CMD) tmp_out 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1048/1D/P1048.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define MAXT 1000 5 | int dp[MAXT + 1]; 6 | 7 | int max(int a , int b) { return a > b ? a : b; } 8 | 9 | int main() { 10 | int t, m, ti, vi; 11 | scanf("%d %d", &t, &m); 12 | for (int i = 0; i < m; i++) { 13 | scanf("%d %d", &ti, &vi); 14 | for (int j = t; j >= ti; j--) 15 | dp[j] = max(dp[j], dp[j - ti] + vi); 16 | } 17 | printf("%d\n", dp[t]); 18 | exit(0); 19 | } 20 | -------------------------------------------------------------------------------- /Problems/P1438/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P1438.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P1438 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | 23 | $(TARGET) : P1438.c 24 | $(CC) -o $@ $< $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P1972/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P1972.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P1972 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | 23 | $(TARGET) : P1972.c 24 | $(CC) -o $@ $< $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P3373/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P3373.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P3373 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | 23 | $(TARGET) : P3373.c 24 | $(CC) -o $@ $< $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P2023/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P2023.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P2023 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | 23 | $(TARGET) : P2023.c 24 | $(CC) -o $@ $< $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P2068/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) #Windows 2 | TARGET = P2068.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) #Linux 8 | TARGET = P2068 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | $(TARGET) : P2068.c 23 | $(CC) -o $@ $< $(CFLAGS) 24 | -------------------------------------------------------------------------------- /Problems/P2880/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P2880.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P2880 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | 23 | $(TARGET) : P2880.c 24 | $(CC) -o $(TARGET) P2880.c $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P4879/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P4879.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P4879 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | CC = gcc 15 | CFLAGS = -std=c99 16 | 17 | run : $(TARGET) input 18 | $(EXECUTE) < input 19 | 20 | clean : 21 | $(CLEAN) 22 | 23 | $(TARGET) : P4879.c 24 | $(CC) -o $(TARGET) P4879.c $(CFLAGS) 25 | -------------------------------------------------------------------------------- /Problems/P1005/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1005 2 | 3 | ifeq ($(OS), Windows) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1040/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1040 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1063/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1063 2 | 3 | ifeq ($(OS)), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1356/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1356 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1430/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1430 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1651/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1651 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P1944/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1944 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2585/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2585 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P3195/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3195 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P3800/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3800 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/U138763/makefile: -------------------------------------------------------------------------------- 1 | OJ = U138763 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2925/P2925.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int dp[50001]; 5 | 6 | int max(int a, int b) { 7 | return a > b ? a : b; 8 | } 9 | 10 | int main() { 11 | int c, h, v; 12 | scanf("%d %d", &c, &h); 13 | for (int i = 0; i < h; i++) { 14 | scanf("%d", &v); 15 | for (int j = c; j >= v; j--) { 16 | dp[j] = max(dp[j], dp[j - v] + v); 17 | if (i == h - 1) break; 18 | } 19 | } 20 | printf("%d", dp[c]); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P3408/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P3408 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run: $(TARGET) in out 21 | $(RUN) < in > tmp_out 22 | -$(DIFF) tmp_out out 23 | $(CLEAN_CMD) tmp_out 24 | 25 | clean: $(TARGET) 26 | $(CLEAN_CMD) $< 27 | -------------------------------------------------------------------------------- /Problems/P3810/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++17 2 | 3 | OJ = P3810 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) in out 21 | $(RUN) < in > tmp_out 22 | -$(DIFF) tmp_out out 23 | $(CLEAN_CMD) tmp_out 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | -------------------------------------------------------------------------------- /Problems/P4552/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P4552.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN = del $(TARGET) 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P4552 9 | EXECUTE = ./$(TARGET) 10 | CLEAN = rm $(TARGET) 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input 15 | $(EXECUTE) < input 16 | 17 | clean : $(TARGET) 18 | $(CLEAN) 19 | 20 | CC = gcc 21 | CFLAGS = -std=c99 22 | SRC = P4552.c 23 | 24 | $(TARGET) : $(SRC) 25 | $(CC) -o $@ $< $(CFLAGS) 26 | -------------------------------------------------------------------------------- /Problems/P1801/makefile: -------------------------------------------------------------------------------- 1 | QUESTION = P1801 2 | ifeq ($(OS), Windows_NT) 3 | TARGET = $(QUESTION).exe 4 | EXECUTE = $(TARGET) 5 | CLEAN = del $(TARGET) 6 | else 7 | UNAME_S = $(shell uname -s) 8 | ifeq ($(UNAME_S), Linux) 9 | TARGET = $(QUESTION) 10 | EXECUTE = ./$(TARGET) 11 | CLEAN = rm $(TARGET) 12 | endif 13 | endif 14 | 15 | run : $(TARGET) input 16 | $(EXECUTE) < input 17 | 18 | clean : $(TARGET) 19 | $(CLEAN) 20 | 21 | CC = g++ 22 | SRC = $(QUESTION).cc 23 | 24 | $(TARGET) : $(SRC) 25 | $(CC) -o $@ $< 26 | -------------------------------------------------------------------------------- /Problems/P1060/1D/P1060.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define MAXN 30000 5 | 6 | int dp[MAXN + 1]; 7 | 8 | int max(int a, int b) { return a > b ? a : b; } 9 | 10 | int main() { 11 | int n, m; 12 | scanf("%d %d", &n, &m); 13 | int v, p; 14 | for (int i = 0; i < m; i++) { 15 | scanf("%d %d", &v, &p); 16 | p *= v; 17 | for (int j = n; j >= v; j--) 18 | dp[j] = max(dp[j], dp[j - v] + p); 19 | } 20 | printf("%d\n", dp[n]); 21 | exit(0); 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P2015/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P2015 4 | ifeq ($(OS), Windows_NT) 5 | TARGET = $(OJ).exe 6 | RUN = $(TARGET) 7 | CLEAN_CMD = del 8 | else 9 | UNAME_S := $(shell uname -s) 10 | ifeq ($(UNAME_S), Linux) 11 | TARGET = $(OJ) 12 | RUN = ./$(TARGET) 13 | CLEAN_CMD = rm 14 | endif 15 | endif 16 | 17 | DIFF = diff -b 18 | 19 | run : $(TARGET) input output 20 | $(RUN) < input > tmp_output 21 | -$(DIFF) tmp_output output 22 | $(CLEAN_CMD) tmp_output 23 | 24 | clean : $(TARGET) 25 | $(CLEAN_CMD) $< 26 | -------------------------------------------------------------------------------- /Problems/P1799/P1799.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int dp[1001]; 5 | 6 | int max(int a, int b) { 7 | return a > b ? a : b; 8 | } 9 | 10 | int main() { 11 | int n, a, res = 0; 12 | scanf("%d", &n); 13 | for (int i = 1; i <= n; i++) { 14 | scanf("%d", &a); 15 | for (int j = i; j >= 1; j--) { 16 | dp[j] = max(dp[j], dp[j - 1] + (a == j ? 1 : 0)); 17 | if (dp[j] > res) res = dp[j]; 18 | } 19 | } 20 | printf("%d", res); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P5146/P5146_1.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int min(int a, int b) { return a < b ? a : b; } 5 | int max(int a, int b) { return a > b ? a : b; } 6 | int dp[1000000]; 7 | 8 | int main() { 9 | int n, res = 0; 10 | scanf("%d", &n); 11 | for (int i = 0; i < n; i++) { 12 | scanf("%d", dp + i); 13 | if (i) { 14 | res = max(res, dp[i] - dp[i - 1]); 15 | dp[i] = min(dp[i], dp[i - 1]); 16 | } 17 | } 18 | printf("%d", res); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Problems/P1091/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1091 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1121/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1121 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1122/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P1122 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) input output 21 | $(RUN) < input > tmp_output 22 | -$(DIFF) tmp_output output 23 | $(CLEAN_CMD) tmp_output 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | -------------------------------------------------------------------------------- /Problems/P1131/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P1131 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) input output 21 | $(RUN) < input > tmp_output 22 | -$(DIFF) tmp_output output 23 | $(CLEAN_CMD) tmp_output 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | -------------------------------------------------------------------------------- /Problems/P1171/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1171 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1339/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1339 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1417/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1417 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1440/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1440 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1450/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1450 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1483/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1483 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1508/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1508 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1565/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1565 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1666/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1666 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1714/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1714 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1723/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1723 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1782/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1782 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2034/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2034 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2053/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2053 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2106/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2106 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2107/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2107 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2182/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2182 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2190/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2190 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2306/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2306 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2422/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2422 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2517/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2517 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2602/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2602 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2629/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2629 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2657/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2657 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2966/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2966 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3071/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3071 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3177/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P3177 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) input output 21 | $(RUN) < input > tmp_output 22 | -$(DIFF) tmp_output output 23 | $(CLEAN_CMD) tmp_output 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | -------------------------------------------------------------------------------- /Problems/P3377/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3377 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3379/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3379 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3381/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3381 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3384/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3384 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3391/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3391 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3545/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3545 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3805/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3805 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P3817/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3817 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P4014/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4014 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P4362/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4362 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P4722/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4722 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P4805/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4805 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P4999/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4999 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P5202/makefile: -------------------------------------------------------------------------------- 1 | OJ = P5202 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P5958/makefile: -------------------------------------------------------------------------------- 1 | OJ = P5958 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P6040/makefile: -------------------------------------------------------------------------------- 1 | OJ = P6040 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P6855/makefile: -------------------------------------------------------------------------------- 1 | OJ = P6855 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P7535/makefile: -------------------------------------------------------------------------------- 1 | OJ = P7535 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P7925/makefile: -------------------------------------------------------------------------------- 1 | OJ = P7925 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P1973/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1973 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | -------------------------------------------------------------------------------- /Problems/P2170/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2170 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN) $< 28 | -------------------------------------------------------------------------------- /Problems/P1198/makefile: -------------------------------------------------------------------------------- 1 | QUESTION = P1198 2 | ifeq ($(OS), Windows_NT) 3 | TARGET = $(QUESTION).exe 4 | EXECUTE = $(TARGET) 5 | CLEAN = del $(TARGET) 6 | else 7 | UNAME_S := $(shell uname -s) 8 | ifeq ($(UNAME_S), Linux) 9 | TARGET = $(QUESTION) 10 | EXECUTE = ./$(TARGET) 11 | CLEAN = rm $(TARGET) 12 | endif 13 | endif 14 | 15 | run : $(TARGET) input 16 | $(EXECUTE) < input 17 | 18 | clean : $(TARGET) 19 | $(CLEAN) 20 | 21 | CC = gcc 22 | CFLAGS = -std=c99 23 | SRC = $(QUESTION).c 24 | 25 | $(TARGET) : $(SRC) 26 | $(CC) -o $@ $< $(CFLAGS) 27 | -------------------------------------------------------------------------------- /Problems/P3800/Solution.md: -------------------------------------------------------------------------------- 1 | ## DP+单调队列优化 2 | 3 | dp[i][j]表示在(i, j)位置向下走能得到的最大power 4 | 最终答案即 max{dp[0][j]} 5 | 显然最下面一行 dp[n - 1][j] 的值即(n - 1, j)位置的value 6 | 而转移方程 dp[i][j] = max{dp[i + 1][k]} + (i, j)位置的value, 其中 k >= j - t && k <= j + t && k >= 0 && k < m 7 | 枚举i, j, k的复杂度为O(n的3次方),可以用单调队列优化 8 | 对于每一行i, 当j = 0时,k需要从[0, t]中间取值,而当j每次增1,k的取值范围都会向右移1, 9 | 即若对于j, k的取值范围是[j - t, j + t],那么对于j + 1, k的取值范围是[j + 1 - t, j + 1 + t] 10 | 对这个范围中的每个k, 用单调队列维护dp[i + 1][k],当j增1,单调队列Push新值dp[i + 1][j + t], 同时将过期的值出队 11 | 队列中的最大值加上(i, j)位置的value即dp[i][j] 12 | -------------------------------------------------------------------------------- /Problems/P5146/P5146_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() { 5 | int n; 6 | scanf("%d", &n); 7 | int a, min_a; 8 | long long sub, max_sub = 0x8000000000000000; 9 | scanf("%d", &a); // first element 10 | min_a = a; 11 | for (int i = 1; i < n; i++) { //n - 1 elements 12 | scanf("%d", &a); 13 | sub = (long long)a - (long long)min_a; 14 | if (sub > max_sub) max_sub = sub; 15 | if (a < min_a) min_a = a; 16 | } 17 | printf("%lld\n", max_sub); 18 | exit(0); 19 | } 20 | -------------------------------------------------------------------------------- /Problems/P1280/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1280 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | CXXFLAGS+=std=c++11 6 | 7 | windows : $(OJ).exe in out 8 | $< < in > tmp_out 9 | -FC tmp_out out 10 | del tmp_out 11 | 12 | linux : $(OJ) in out 13 | ./$< < in > tmp_out 14 | -diff -b tmp_out out 15 | rm tmp_out 16 | 17 | $(OJ).exe : $(OBJ) 18 | $(CC) $< -o $@ 19 | 20 | $(OJ) : $(OBJ) 21 | $(CC) $< -o $@ 22 | 23 | $(OBJ) : $(SRC) 24 | $(CC) -c $< 25 | 26 | windows_clean : 27 | del $(OBJ) 28 | del $(OJ).exe 29 | 30 | linux_clean : 31 | rm $(OBJ) 32 | rm $(OJ) 33 | -------------------------------------------------------------------------------- /Problems/P5994/makefile: -------------------------------------------------------------------------------- 1 | OJ = P5994 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | CXXFLAGS+=std=c++11 6 | 7 | windows : $(OJ).exe in out 8 | $< < in > tmp_out 9 | -FC tmp_out out 10 | del tmp_out 11 | 12 | linux : $(OJ) in out 13 | ./$< < in > tmp_out 14 | -diff -b tmp_out out 15 | rm tmp_out 16 | 17 | $(OJ).exe : $(OBJ) 18 | $(CC) $< -o $@ 19 | 20 | $(OJ) : $(OBJ) 21 | $(CC) $< -o $@ 22 | 23 | $(OBJ) : $(SRC) 24 | $(CC) -c $< 25 | 26 | windows_clean : 27 | del $(OBJ) 28 | del $(OJ).exe 29 | 30 | linux_clean : 31 | rm $(OBJ) 32 | rm $(OJ) 33 | -------------------------------------------------------------------------------- /Problems/P1164/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1164 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | -------------------------------------------------------------------------------- /Problems/P1303/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1303 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | -------------------------------------------------------------------------------- /Problems/P1410/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1410 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | -------------------------------------------------------------------------------- /Problems/P1759/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1759 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | CC = gcc 25 | SRC = $(OJ).c 26 | 27 | $(TARGET) : $(SRC) 28 | $(CC) -o $@ $< 29 | -------------------------------------------------------------------------------- /Problems/P2889/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2889 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | -------------------------------------------------------------------------------- /Problems/P4095/makefile: -------------------------------------------------------------------------------- 1 | OJ = P4095 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | -------------------------------------------------------------------------------- /Problems/P1433/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1433 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | -$(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean: $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | CC = gcc 27 | $(TARGET) : $(OJ).c 28 | $(CC) $< -o $@ -lm 29 | -------------------------------------------------------------------------------- /Problems/P2439/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2439 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | -------------------------------------------------------------------------------- /Problems/P2863/c/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2863 2 | SRC = $(OJ).c 3 | OBJ = $(OJ).o 4 | CC = gcc 5 | 6 | windows : $(OJ).exe in out 7 | $< < in > tmp_out 8 | -FC tmp_out out 9 | del tmp_out 10 | 11 | linux : $(OJ) in out 12 | ./$< < in > tmp_out 13 | -diff -b tmp_out out 14 | rm tmp_out 15 | 16 | $(OJ).exe : $(OBJ) 17 | $(CC) $< -o $@ $(CXXFLAGS) 18 | 19 | $(OJ) : $(OBJ) 20 | $(CC) $< -o $@ $(CXXFLAGS) 21 | 22 | $(OBJ) : $(SRC) 23 | $(CC) -c $< $(CXXFLAGS) 24 | 25 | windows_clean : 26 | del $(OBJ) 27 | del $(OJ).exe 28 | 29 | linux_clean : 30 | rm $(OBJ) 31 | rm $(OJ) 32 | -------------------------------------------------------------------------------- /Problems/P2722/P2722.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int dp[10001]; 5 | short score[10000]; 6 | short time[10000]; 7 | 8 | #ifndef max 9 | #define max(a, b) ((a) > (b) ? (a) : (b)) 10 | #endif 11 | 12 | int main() { 13 | int m, n; 14 | scanf("%d %d", &m, &n); 15 | for (int i = 0; i < n; i++) 16 | scanf("%hd %hd", score + i, time + i); 17 | for (int i = 0; i < n; i++) 18 | for (int j = time[i]; j <= m; j++) 19 | dp[j] = max(dp[j], dp[j - time[i]] + score[i]); 20 | printf("%d", dp[m]); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P5788/P5788.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | #define N 3000006 5 | 6 | int a[N], q[N], f[N]; 7 | 8 | int main() { 9 | int n, i, r; 10 | scanf("%d", &n); 11 | for (i = 0; i < n; i++) scanf("%d", &a[i]); 12 | r = 0; 13 | for (i = n - 1; i >= 0; i--) { 14 | while (r && a[i] >= a[q[r]]) r--; 15 | if (r) 16 | f[i] = q[r] + 1; //从0开始转为从1开始 17 | else f[i] = 0; 18 | q[++r] = i; 19 | } 20 | for (i = 0; i < n - 1; i++) printf("%d ", f[i]); printf("%d", f[n - 1]); 21 | exit(0); 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P2824/makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(OS), Windows) 2 | UNAME_S := $(shell uname -s) 3 | ifeq ($(UNAME_S), Linux) 4 | TARGET = P2824 5 | EXECUTE_CMD = ./ 6 | CLEAN_CMD = rm 7 | endif 8 | else 9 | TARGET = P2824.exe 10 | EXECUTE_CMD = #empty 11 | CLEAN_CMD = del 12 | endif 13 | 14 | run : $(TARGET) input output 15 | $(EXECUTE_CMD)$(TARGET) < input > tmp_output 16 | diff tmp_output output 17 | $(CLEAN_CMD) tmp_output 18 | 19 | clean : 20 | $(CLEAN_CMD) $(TARGET) 21 | 22 | CC = gcc 23 | CFLAGS = -std=c99 24 | SRC = P2824.c 25 | 26 | $(TARGET) : $(SRC) 27 | $(CC) -o $@ $< $(CFLAGS) 28 | -------------------------------------------------------------------------------- /Problems/P3387/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS += -std=c++11 2 | CC = g++ 3 | 4 | OJ = P3387 5 | 6 | ifeq ($(OS), Windows_NT) 7 | TARGET = $(OJ).exe 8 | RUN = $(TARGET) 9 | CLEAN = del 10 | else 11 | UNAME_S := $(shell uname -s) 12 | ifeq ($(UNAME_S), Linux) 13 | TARGET = $(OJ) 14 | RUN = ./$(TARGET) 15 | CLEAN = rm 16 | endif 17 | endif 18 | 19 | DIFF = diff -b 20 | 21 | run : $(TARGET) input output 22 | $(RUN) < input > tmp_output 23 | $(DIFF) tmp_output output 24 | $(CLEAN) tmp_output 25 | 26 | clean : $(TARGET) 27 | $(CLEAN) $< 28 | 29 | clean_tmp_output : tmp_output 30 | $(CLEAN) $< 31 | -------------------------------------------------------------------------------- /Problems/P3919/makefile: -------------------------------------------------------------------------------- 1 | OJ = P3919 2 | 3 | ifeq ($(OS), Windows) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | CC = gcc 25 | CFLAGS = -std=c99 26 | SRC = $(OJ).c 27 | 28 | $(TARGET) : $(SRC) 29 | $(CC) -o $@ $< $(CFLAGS) 30 | -------------------------------------------------------------------------------- /Problems/P1453/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS += -std=c++11 2 | 3 | OJ = P1453 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) input output 21 | $(RUN) < input > tmp_output 22 | $(DIFF) tmp_output output 23 | $(CLEAN_CMD) tmp_output 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | 28 | clean_tmp_output : tmp_output 29 | $(CLEAN_CMD) $< 30 | -------------------------------------------------------------------------------- /Problems/P1712/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P1712.exe 3 | EXECUTE_CMD = #empty 4 | CLEAN_CMD = del 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P1712 9 | EXECUTE_CMD = ./ 10 | CLEAN_CMD = rm 11 | endif 12 | endif 13 | 14 | 15 | run : $(TARGET) input output 16 | $(EXECUTE_CMD)$(TARGET) < input > tmp_output 17 | diff tmp_output output 18 | $(CLEAN_CMD) tmp_output 19 | 20 | clean : 21 | $(CLEAN_CMD) $(TARGET) 22 | 23 | CC = gcc 24 | CFLAGS = -std=c99 25 | SRC = P1712.c 26 | 27 | $(TARGET) : $(SRC) 28 | $(CC) -o $@ $< $(CFLAGS) 29 | -------------------------------------------------------------------------------- /Problems/P2341/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2341 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CXXFLAGS += -std=c++11 30 | -------------------------------------------------------------------------------- /Problems/P2746/makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS+=-std=c++11 2 | 3 | OJ = P2746 4 | 5 | ifeq ($(OS), Windows_NT) 6 | TARGET = $(OJ).exe 7 | RUN = $(TARGET) 8 | CLEAN_CMD = del 9 | else 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S), Linux) 12 | TARGET = $(OJ) 13 | RUN = ./$(TARGET) 14 | CLEAN_CMD = rm 15 | endif 16 | endif 17 | 18 | DIFF = diff -b 19 | 20 | run : $(TARGET) input output 21 | $(RUN) < input > tmp_output 22 | $(DIFF) tmp_output output 23 | $(CLEAN_CMD) tmp_output 24 | 25 | clean : $(TARGET) 26 | $(CLEAN_CMD) $< 27 | 28 | clean_tmp_output : tmp_output 29 | $(CLEAN_CMD) $< 30 | -------------------------------------------------------------------------------- /Problems/P1345/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1345 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | CXXFLAGS += -std=c++11 6 | 7 | windows : $(OJ).exe in out 8 | $< < in > tmp_out 9 | -FC tmp_out out 10 | del tmp_out 11 | 12 | linux : $(OJ) in out 13 | ./$< < in > tmp_out 14 | -diff -b tmp_out out 15 | rm tmp_out 16 | 17 | 18 | $(OJ).exe : $(OBJ) 19 | $(CC) $< -o $@ $(CXXFLAGS) 20 | 21 | $(OJ) : $(OBJ) 22 | $(CC) $< -o $@ $(CXXFLAGS) 23 | 24 | $(OBJ) : $(SRC) 25 | $(CC) -c $< $(CXXFLAGS) 26 | 27 | win_clean : 28 | del $(OBJ) 29 | del $(OJ).exe 30 | 31 | li_clean : 32 | rm $(OBJ) 33 | rm $(OJ) 34 | -------------------------------------------------------------------------------- /Problems/P1558/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P1558.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN_CMD = del 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P1558 9 | EXECUTE = ./$(TARGET) 10 | CLEAN_CMD = rm 11 | endif 12 | endif 13 | 14 | run : $(TARGET) input output 15 | $(EXECUTE) < input > tmp_output 16 | diff output tmp_output 17 | $(CLEAN_CMD) tmp_output 18 | 19 | clean : $(TARGET) 20 | $(CLEAN_CMD) $(TARGET) 21 | 22 | CC = gcc 23 | CFLAGS = -std=c99 24 | SRC = P1558.c 25 | 26 | $(TARGET) : $(SRC) 27 | $(CC) -o $@ $< $(CFLAGS) 28 | 29 | -------------------------------------------------------------------------------- /Problems/P2863/cc/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2863 2 | SRC = $(OJ).cc 3 | OBJ = $(OJ).o 4 | CC = g++ 5 | CXXFLAGS += -std=c++11 6 | 7 | windows : $(OJ).exe in out 8 | $< < in > tmp_out 9 | -FC tmp_out out 10 | del tmp_out 11 | 12 | linux : $(OJ) in out 13 | ./$< < in > tmp_out 14 | -diff -b tmp_out out 15 | rm tmp_out 16 | 17 | $(OJ).exe : $(OBJ) 18 | $(CC) $< -o $@ $(CXXFLAGS) 19 | 20 | $(OJ) : $(OBJ) 21 | $(CC) $< -o $@ $(CXXFLAGS) 22 | 23 | $(OBJ) : $(SRC) 24 | $(CC) -c $< $(CXXFLAGS) 25 | 26 | windows_clean : 27 | del $(OBJ) 28 | del $(OJ).exe 29 | 30 | linux_clean : 31 | rm $(OBJ) 32 | rm $(OJ) 33 | -------------------------------------------------------------------------------- /Problems/P3817/P3817.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define max(a, b) ((a) > (b) ? (a) : (b)) 5 | 6 | typedef long long ll; 7 | 8 | int main() { 9 | int n, x, a, b; 10 | ll ans = 0; 11 | scanf("%d %d", &n, &x); 12 | scanf("%d", &a); 13 | for (int i = 1; i < n; i++) { 14 | scanf("%d", &b); 15 | if (a + b <= x) { 16 | a = b; 17 | } 18 | else { 19 | ans += a + b - x; 20 | a = max(0, x - a); // b - (a + b - x) = x - a 21 | } 22 | } 23 | printf("%lld", ans); 24 | exit(0); 25 | } 26 | -------------------------------------------------------------------------------- /Problems/P2574/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | TARGET = P2574.exe 3 | EXECUTE = $(TARGET) 4 | CLEAN_CMD = del 5 | else 6 | UNAME_S := $(shell uname -s) 7 | ifeq ($(UNAME_S), Linux) 8 | TARGET = P2574 9 | EXECUTE = ./$(TARGET) 10 | CLEAN_CMD = rm 11 | endif 12 | endif 13 | 14 | CLEAN = $(CLEAN_CMD) $(TARGET) 15 | 16 | run : $(TARGET) input output 17 | $(EXECUTE) < input > tmp_output 18 | diff output tmp_output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : 22 | $(CLEAN) 23 | 24 | CC = gcc 25 | CFLAGS = -std=c99 26 | SRC = P2574.c 27 | 28 | $(TARGET) : $(SRC) 29 | $(CC) -o $@ $< $(CFLAGS) 30 | -------------------------------------------------------------------------------- /Problems/P1507/P1507.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | #define maxv 400 5 | #define maxw 400 6 | 7 | int dp[maxv][maxw]; 8 | 9 | int max(int a, int b) { return a > b ? a : b; } 10 | 11 | int main() { 12 | int v, w, n; 13 | scanf("%d %d %d", &v, &w, &n); 14 | int vi, wi, ci; 15 | for (int i = 0; i < n; i++) { 16 | scanf("%d %d %d", &vi, &wi, &ci); 17 | for (int j = v; j >= vi; j--) 18 | for (int k = w; k >= wi; k--) 19 | dp[j][k] = max(dp[j][k], dp[j - vi][k - wi] + ci); 20 | } 21 | printf("%d", dp[v][w]); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Problems/P1533/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1533 2 | ifeq ($(OS), Windows_NT) 3 | TARGET = $(OJ).exe 4 | EXECUTE_CMD = #empty 5 | CLEAN_CMD = del 6 | else 7 | UNAME_S := $(shell uname -s) 8 | ifeq ($(UNAME_S), Linux) 9 | TARGET = $(OJ) 10 | EXECUTE_CMD = ./ 11 | CLEAN_CMD = rm 12 | endif 13 | endif 14 | 15 | run : $(TARGET) input output 16 | $(EXECUTE_CMD)$(TARGET) < input > tmp_output 17 | diff tmp_output output 18 | $(CLEAN_CMD) tmp_output 19 | 20 | clean : $(TARGET) 21 | $(CLEAN_CMD) $< 22 | 23 | CC = g++ 24 | CXXFLAGS = -std=c++11 25 | SRC = $(OJ).cc 26 | 27 | $(TARGET) : $(SRC) 28 | $(CC) -o $@ $< $(CXXFLAGS) 29 | -------------------------------------------------------------------------------- /Problems/P1049/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1049 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1220/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1220 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1564/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1564 2 | 3 | ifeq ($(OJ), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(OJ) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1650/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1650 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1736/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1736 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(OJ) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1799/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1799 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(OJ) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P2584/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2584 2 | ifeq ($(OS), Windows_NT) 3 | TARGET = $(OJ).exe 4 | EXECUTE_CMD = #empty 5 | CLEAN_CMD = del 6 | else 7 | UNAME_S := $(shell uname -s) 8 | ifeq ($(UNAME_S), Linux) 9 | TARGET = $(OJ) 10 | EXECUTE_CMD = ./ 11 | CLEAN_CMD = rm 12 | endif 13 | endif 14 | 15 | run : $(TARGET) input output 16 | $(EXECUTE_CMD)$(TARGET) < input > tmp_output 17 | diff tmp_output output 18 | $(CLEAN_CMD) tmp_output 19 | 20 | clean : $(TARGET) 21 | $(CLEAN_CMD) $(TARGET) 22 | 23 | CC = g++ 24 | SRC = $(OJ).cc 25 | CXXFLAGS = -std=c++11 26 | 27 | $(TARGET) : $(SRC) 28 | $(CC) -o $@ $< $(CXXFLAGS) 29 | -------------------------------------------------------------------------------- /Problems/P2679/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2679 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P2690/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2690 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC= $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P2925/makefile: -------------------------------------------------------------------------------- 1 | OJ = P2925 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | run : $(TARGET) input output 17 | $(RUN) < input > tmp_output 18 | diff -b tmp_output output 19 | $(CLEAN_CMD) tmp_output 20 | 21 | clean : $(TARGET) 22 | $(CLEAN_CMD) $< 23 | 24 | clean_tmp_output : tmp_output 25 | $(CLEAN_CMD) $< 26 | 27 | CC = gcc 28 | SRC = $(OJ).c 29 | 30 | $(TARGET) : $(SRC) 31 | $(CC) -o $@ $< 32 | -------------------------------------------------------------------------------- /Problems/P1048/2D/P1048.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define MAXM 100 5 | #define MAXT 1000 6 | int dp[MAXM + 1][MAXT + 1]; //2D 7 | 8 | int max(int a, int b) { return a > b ? a : b; } 9 | 10 | int main() { 11 | int t, m, ti, vi; 12 | scanf("%d %d", &t, &m); 13 | for (int i = 1; i <= m; i++) { 14 | scanf("%d %d", &ti, &vi); 15 | for (int j = 1; j < ti; j++) 16 | dp[i][j] = dp[i - 1][j]; 17 | for (int j = ti; j <= t; j++) 18 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - ti] + vi); 19 | } 20 | printf("%d\n", dp[m][t]); 21 | exit(0); 22 | } 23 | -------------------------------------------------------------------------------- /Problems/P2690/P2690.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | int dp[31]; 5 | 6 | int max(int a, int b) { 7 | return a > b ? a : b; 8 | } 9 | 10 | int main() { 11 | int t, w, a; 12 | scanf("%d %d", &t, &w); 13 | for (int i = 1; i <= t; i++) { 14 | scanf("%d", &a); 15 | for (int j = w; j >= 0; j--) { 16 | if (j > 0) dp[j] = max(dp[j], dp[j - 1]); 17 | if (a == (j % 2 + 1)) dp[j]++; 18 | } 19 | } 20 | int res = 0; 21 | for (int j = 0; j <= w; j++) 22 | res = max(res, dp[j]); 23 | printf("%d", res); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Problems/P1509/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1509 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(RUN) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1734/P1734.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | #ifndef max 5 | #define max(a, b) ((a) > (b) ? (a) : (b)) 6 | #endif 7 | 8 | int dp[1001]; 9 | int value[1001]; 10 | //weight[i] = i 11 | 12 | int main() { 13 | int s; 14 | scanf("%d", &s); 15 | for (int i = 1; i <= s / 2; i++) 16 | for (int j = i + 1; j <= s; j++) 17 | if (j % i == 0) value[j] += i; 18 | for (int i = 0; i < s; i++) 19 | for (int j = s; j >= i; j--) { 20 | dp[j] = max(dp[j], dp[j - i] + value[i]); 21 | if (i == s - 1) break; 22 | } 23 | printf("%d", dp[s]); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Problems/P1802/P1802.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "stdlib.h" 3 | 4 | #define maxx 1000 5 | 6 | int dp[maxx + 1]; 7 | 8 | int max(int a, int b) { return a > b ? a : b; } 9 | 10 | int main() { 11 | int n, x, lose, win, use; 12 | scanf("%d %d", &n, &x); 13 | int i, j; 14 | for (i = 0; i < n; i++) { 15 | scanf("%d %d %d", &lose, &win, &use); 16 | for (j = x; j >= use; j--) 17 | dp[j] = max(dp[j] + lose, dp[j - use] + win); 18 | for (j = use - 1; j >= 0; j--) 19 | dp[j] = dp[j] + lose; 20 | } 21 | long long ans = dp[x]; 22 | printf("%lld", ans * 5); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Problems/P1802/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1802 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmpoutput : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1880/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1880 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output: tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1060/2D/P1060.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define MAXM 24 5 | #define MAXN 30000 6 | 7 | int dp[MAXM + 1][MAXN + 1]; 8 | 9 | int max(int a, int b) {return a > b ? a : b; } 10 | 11 | int main() { 12 | int n, m; 13 | scanf("%d %d", &n, &m); 14 | int v, p; 15 | for (int i = 1; i <= m; i++) { 16 | scanf("%d %d", &v, &p); 17 | p *= v; 18 | for (int j = 0; j < v; j++) 19 | dp[i][j] = dp[i - 1][j]; 20 | for (int j = v; j <= n; j++) 21 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - v] + p); 22 | } 23 | printf("%d\n", dp[m][n]); 24 | exit(0); 25 | } 26 | -------------------------------------------------------------------------------- /Problems/P1103/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1103 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1107/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1107 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1281/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1281 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1353/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1353 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1429/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1429 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = g++ 30 | SRC = $(OJ).cc 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | -------------------------------------------------------------------------------- /Problems/P1854/makefile: -------------------------------------------------------------------------------- 1 | OJ = P1854 2 | 3 | ifeq ($(OS), Windows_NT) 4 | TARGET = $(OJ).exe 5 | RUN = $(TARGET) 6 | CLEAN_CMD = del 7 | else 8 | UNAME_S := $(shell uname -s) 9 | ifeq ($(UNAME_S), Linux) 10 | TARGET = $(OJ) 11 | RUN = ./$(TARGET) 12 | CLEAN_CMD = rm 13 | endif 14 | endif 15 | 16 | DIFF = diff -b 17 | 18 | run : $(TARGET) input output 19 | $(RUN) < input > tmp_output 20 | $(DIFF) tmp_output output 21 | $(CLEAN_CMD) tmp_output 22 | 23 | clean : $(TARGET) 24 | $(CLEAN_CMD) $< 25 | 26 | clean_tmp_output : tmp_output 27 | $(CLEAN_CMD) $< 28 | 29 | CC = gcc 30 | SRC = $(OJ).c 31 | 32 | $(TARGET) : $(SRC) 33 | $(CC) -o $@ $< 34 | --------------------------------------------------------------------------------