CSP-J 必刷题

队列

  1. P5661
  2. P1540
  3. P1996
  4. P2952
  5. P1886
  6. P2058
  7. P3662
  8. P7912

  1. P1981
  2. P3056
  3. P1165
  4. P2866
  5. P1901
  6. P4387
  7. P1175

前缀和(差分)

  1. P6568
  2. P1147
  3. P6625
  4. P3397
  5. P9094
  6. P3068
  7. P5542
  8. P2367
  9. P3662

二分

  1. P1571
  2. P1678
  3. P1918
  4. P8814
  5. P1824
  6. P2920
  7. P2985
  8. P1873
  9. P1843
  10. P2678
  11. P2440

数学思维

  1. P9585
  2. P7226
  3. P7257
  4. P7772
  5. P1035
  6. P1150
  7. P1425
  8. P1851
  9. P1876
  10. P1887
  11. P2669
  12. P2705
  13. P6421
  14. P1146
  15. P7199
  16. P7909
  17. P1293
  18. P6188
  19. P8177
  20. P9748
  21. P9750
  22. P1619
  23. P8050

GCD / LCM

  1. P1075
  2. P8443
  3. P1217
  4. P2118
  5. P1029
  6. P4057
  7. P3383

模拟

  1. P6352
  2. P8813
  3. P7071
  4. P1909
  5. P1421
  6. P1420
  7. P1307
  8. P1179
  9. P6386
  10. P8318
  11. P1047
  12. P1046
  13. P1085
  14. P1089
  15. P1152
  16. P1548
  17. P2356
  18. P1614
  19. P6437
  20. P1003
  21. P7072
  22. P1008
  23. P1097
  24. P1109
  25. P1563
  26. P2010
  27. P5412
  28. P3955
  29. P5016
  30. P2681
  31. P2692
  32. P3392
  33. P3817
  34. P1190
  35. P9749
  36. P1059
  37. P1093
  38. P8874
  39. P2007
  40. P2239
  41. P7186
  42. P1969
  43. P9287
  44. P1065
  45. P3585
  46. P9553
  47. P8831
  48. P9974
  49. P8685
  50. P2348
  51. P1076
  52. P7910

BFS

  1. P1443
  2. P1746
  3. P1747
  4. P3395
  5. P1135
  6. P1332
  7. P2895
  8. P7243
  9. P2903

DFS

  1. P1123
  2. P1219
  3. P6207
  4. P8838
  5. P2919

字符串

  1. P1321
  2. P1597
  3. P1765
  4. P5015
  5. P5660
  6. P5832
  7. P6263
  8. P6382
  9. P1055
  10. P1067
  11. P1098
  12. P1104
  13. P1308
  14. P1603
  15. P1808
  16. P1572
  17. P2708
  18. P2957
  19. P1022
  20. P3880
  21. P6051
  22. P7911

线性 DP

  1. P2362
  2. P1203
  3. P2008
  4. P8707
  5. P1002
  6. P1130
  7. P1216
  8. P1115
  9. P1359
  10. P8395
  11. P2837
  12. P1968
  13. P1796
  14. P2800
  15. P3009
  16. P7158
  17. P1569
  18. P1057
  19. P1970
  20. P3399
  21. P1103
  22. P1388
  23. P1140
  24. P1481
  25. P2028
  26. P1233
  27. P7074
  28. P8814
  29. P1977
  30. P5888
  31. P2359
  32. P1799
  33. P1650
  34. P1651

背包 DP

  1. P1507
  2. P2663
  3. P1855
  4. P1910
  5. P1510
  6. P1048
  7. P1049
  8. P1060
  9. P1164
  10. P1734
  11. P2347
  12. P1926
  13. P2430
  14. P1877
  15. P2639
  16. P2925
  17. P2871
  18. P1616
  19. P1679
  20. P1832
  21. P2722
  22. P2918
  23. P2904
  24. P1853
  25. P1509
  26. P1504
  27. P1077
  28. P2340
  29. P6771
  30. P2725
  31. P1833
  32. P5662
  33. P5365
  34. P5322
  35. P1156
  36. P1776

区间 DP

  1. P1775
  2. P2858
  3. P2426
  4. P1063
  5. P3147
  6. P3146
  7. P4170
  8. P3205
  9. P8675
  10. P1622

建图搜索

  1. P8605
  2. P8604
  3. P5318
  4. P1330
  5. P1294
  6. P5663
  7. P9751

树形结构

  1. P1827
  2. B3642
  3. P1087
  4. P1030
  5. P1229
  6. P2171
  7. P2052
  8. P8815
  9. P2441
  10. P5018
  11. P7073

源码 Code 供复制(请标明来源)

# 队列

1. [P5661](https://www.luogu.com.cn/problem/P5661)
1. [P1540](https://www.luogu.com.cn/problem/P1540)
1. [P1996](https://www.luogu.com.cn/problem/P1996)
1. [P2952](https://www.luogu.com.cn/problem/P2952)
1. [P1886](https://www.luogu.com.cn/problem/P1886)
1. [P2058](https://www.luogu.com.cn/problem/P2058)
1. [P3662](https://www.luogu.com.cn/problem/P3662)
1. [P7912](https://www.luogu.com.cn/problem/P7912)

# 栈

1. [P1981](https://www.luogu.com.cn/problem/P1981)
1. [P3056](https://www.luogu.com.cn/problem/P3056)
1. [P1165](https://www.luogu.com.cn/problem/P1165)
1. [P2866](https://www.luogu.com.cn/problem/P2866)
1. [P1901](https://www.luogu.com.cn/problem/P1901)
1. [P4387](https://www.luogu.com.cn/problem/P4387)
1. [P1175](https://www.luogu.com.cn/problem/P1175)

# 前缀和(差分)

1. [P6568](https://www.luogu.com.cn/problem/P6568)
1. [P1147](https://www.luogu.com.cn/problem/P1147)
1. [P6625](https://www.luogu.com.cn/problem/P6625)
1. [P3397](https://www.luogu.com.cn/problem/P3397)
1. [P9094](https://www.luogu.com.cn/problem/P9094)
1. [P3068](https://www.luogu.com.cn/problem/P3068)
1. [P5542](https://www.luogu.com.cn/problem/P5542)
1. [P2367](https://www.luogu.com.cn/problem/P2367)
1. [P3662](https://www.luogu.com.cn/problem/P3662)

# 二分
1. [P1571](https://www.luogu.com.cn/problem/P1571)
1. [P1678](https://www.luogu.com.cn/problem/P1678)
1. [P1918](https://www.luogu.com.cn/problem/P1918)
1. [P8814](https://www.luogu.com.cn/problem/P8814)
1. [P1824](https://www.luogu.com.cn/problem/P1824)
1. [P2920](https://www.luogu.com.cn/problem/P2920)
1. [P2985](https://www.luogu.com.cn/problem/P2985)
1. [P1873](https://www.luogu.com.cn/problem/P1873)
1. [P1843](https://www.luogu.com.cn/problem/P1843)
1. [P2678](https://www.luogu.com.cn/problem/P2678)
1. [P2440](https://www.luogu.com.cn/problem/P2440)

# 数学思维

1. [P9585](https://www.luogu.com.cn/problem/P9585)
1. [P7226](https://www.luogu.com.cn/problem/P7226)
1. [P7257](https://www.luogu.com.cn/problem/P7257)
1. [P7772](https://www.luogu.com.cn/problem/P7772)
1. [P1035](https://www.luogu.com.cn/problem/P1035)
1. [P1150](https://www.luogu.com.cn/problem/P1150)
1. [P1425](https://www.luogu.com.cn/problem/P1425)
1. [P1851](https://www.luogu.com.cn/problem/P1851)
1. [P1876](https://www.luogu.com.cn/problem/P1876)
1. [P1887](https://www.luogu.com.cn/problem/P1887)
1. [P2669](https://www.luogu.com.cn/problem/P2669)
1. [P2705](https://www.luogu.com.cn/problem/P2705)
1. [P6421](https://www.luogu.com.cn/problem/P6421)
1. [P1146](https://www.luogu.com.cn/problem/P1146)
1. [P7199](https://www.luogu.com.cn/problem/P7199)
1. [P7909](https://www.luogu.com.cn/problem/P7909)
1. [P1293](https://www.luogu.com.cn/problem/P1293)
1. [P6188](https://www.luogu.com.cn/problem/P6188)
1. [P8177](https://www.luogu.com.cn/problem/P8177)
1. [P9748](https://www.luogu.com.cn/problem/P9748)
1. [P9750](https://www.luogu.com.cn/problem/P9750)
1. [P1619](https://www.luogu.com.cn/problem/P1619)
1. [P8050](https://www.luogu.com.cn/problem/P8050)

# GCD / LCM

1. [P1075](https://www.luogu.com.cn/problem/P1075)
1. [P8443](https://www.luogu.com.cn/problem/P8443)
1. [P1217](https://www.luogu.com.cn/problem/P1217)
1. [P2118](https://www.luogu.com.cn/problem/P2118)
1. [P1029](https://www.luogu.com.cn/problem/P1029)
1. [P4057](https://www.luogu.com.cn/problem/P4057)
1. [P3383](https://www.luogu.com.cn/problem/P3383)

# 模拟

1. [P6352](https://www.luogu.com.cn/problem/P6352)
1. [P8813](https://www.luogu.com.cn/problem/P8813)
1. [P7071](https://www.luogu.com.cn/problem/P7071)
1. [P1909](https://www.luogu.com.cn/problem/P1909)
1. [P1421](https://www.luogu.com.cn/problem/P1421)
1. [P1420](https://www.luogu.com.cn/problem/P1420)
1. [P1307](https://www.luogu.com.cn/problem/P1307)
1. [P1179](https://www.luogu.com.cn/problem/P1179)
1. [P6386](https://www.luogu.com.cn/problem/P6386)
1. [P8318](https://www.luogu.com.cn/problem/P8318)
1. [P1047](https://www.luogu.com.cn/problem/P1047)
1. [P1046](https://www.luogu.com.cn/problem/P1046)
1. [P1085](https://www.luogu.com.cn/problem/P1085)
1. [P1089](https://www.luogu.com.cn/problem/P1089)
1. [P1152](https://www.luogu.com.cn/problem/P1152)
1. [P1548](https://www.luogu.com.cn/problem/P1548)
1. [P2356](https://www.luogu.com.cn/problem/P2356)
1. [P1614](https://www.luogu.com.cn/problem/P1614)
1. [P6437](https://www.luogu.com.cn/problem/P6437)
1. [P1003](https://www.luogu.com.cn/problem/P1003)
1. [P7072](https://www.luogu.com.cn/problem/P7072)
1. [P1008](https://www.luogu.com.cn/problem/P1008)
1. [P1097](https://www.luogu.com.cn/problem/P1097)
1. [P1109](https://www.luogu.com.cn/problem/P1109)
1. [P1563](https://www.luogu.com.cn/problem/P1563)
1. [P2010](https://www.luogu.com.cn/problem/P2010)
1. [P5412](https://www.luogu.com.cn/problem/P5412)
1. [P3955](https://www.luogu.com.cn/problem/P3955)
1. [P5016](https://www.luogu.com.cn/problem/P5016)
1. [P2681](https://www.luogu.com.cn/problem/P2681)
1. [P2692](https://www.luogu.com.cn/problem/P2692)
1. [P3392](https://www.luogu.com.cn/problem/P3392)
1. [P3817](https://www.luogu.com.cn/problem/P3817)
1. [P1190](https://www.luogu.com.cn/problem/P1190)
1. [P9749](https://www.luogu.com.cn/problem/P9749)
1. [P1059](https://www.luogu.com.cn/problem/P1059)
1. [P1093](https://www.luogu.com.cn/problem/P1093)
1. [P8874](https://www.luogu.com.cn/problem/P8874)
1. [P2007](https://www.luogu.com.cn/problem/P2007)
1. [P2239](https://www.luogu.com.cn/problem/P2239)
1. [P7186](https://www.luogu.com.cn/problem/P7186)
1. [P1969](https://www.luogu.com.cn/problem/P1969)
1. [P9287](https://www.luogu.com.cn/problem/P9287)
1. [P1065](https://www.luogu.com.cn/problem/P1065)
1. [P3585](https://www.luogu.com.cn/problem/P3585)
1. [P9553](https://www.luogu.com.cn/problem/P9553)
1. [P8831](https://www.luogu.com.cn/problem/P8831)
1. [P9974](https://www.luogu.com.cn/problem/P9974)
1. [P8685](https://www.luogu.com.cn/problem/P8685)
1. [P2348](https://www.luogu.com.cn/problem/P2348)
1. [P1076](https://www.luogu.com.cn/problem/P1076)
1. [P7910](https://www.luogu.com.cn/problem/P7910)

# BFS

1. [P1443](https://www.luogu.com.cn/problem/P1443)
1. [P1746](https://www.luogu.com.cn/problem/P1746)
1. [P1747](https://www.luogu.com.cn/problem/P1747)
1. [P3395](https://www.luogu.com.cn/problem/P3395)
1. [P1135](https://www.luogu.com.cn/problem/P1135)
1. [P1332](https://www.luogu.com.cn/problem/P1332)
1. [P2895](https://www.luogu.com.cn/problem/P2895)
1. [P7243](https://www.luogu.com.cn/problem/P7243)
1. [P2903](https://www.luogu.com.cn/problem/P2903)

# DFS
1. [P1123](https://www.luogu.com.cn/problem/P1123)
1. [P1219](https://www.luogu.com.cn/problem/P1219)
1. [P6207](https://www.luogu.com.cn/problem/P6207)
1. [P8838](https://www.luogu.com.cn/problem/P8838)
1. [P2919](https://www.luogu.com.cn/problem/P2919)

# 字符串
1. [P1321](https://www.luogu.com.cn/problem/P1321)
1. [P1597](https://www.luogu.com.cn/problem/P1597)
1. [P1765](https://www.luogu.com.cn/problem/P1765)
1. [P5015](https://www.luogu.com.cn/problem/P5015)
1. [P5660](https://www.luogu.com.cn/problem/P5660)
1. [P5832](https://www.luogu.com.cn/problem/P5832)
1. [P6263](https://www.luogu.com.cn/problem/P6263)
1. [P6382](https://www.luogu.com.cn/problem/P6382)
1. [P1055](https://www.luogu.com.cn/problem/P1055)
1. [P1067](https://www.luogu.com.cn/problem/P1067)
1. [P1098](https://www.luogu.com.cn/problem/P1098)
1. [P1104](https://www.luogu.com.cn/problem/P1104)
1. [P1308](https://www.luogu.com.cn/problem/P1308)
1. [P1603](https://www.luogu.com.cn/problem/P1603)
1. [P1808](https://www.luogu.com.cn/problem/P1808)
1. [P1572](https://www.luogu.com.cn/problem/P1572)
1. [P2708](https://www.luogu.com.cn/problem/P2708)
1. [P2957](https://www.luogu.com.cn/problem/P2957)
1. [P1022](https://www.luogu.com.cn/problem/P1022)
1. [P3880](https://www.luogu.com.cn/problem/P3880)
1. [P6051](https://www.luogu.com.cn/problem/P6051)
1. [P7911](https://www.luogu.com.cn/problem/P7911)

# 线性 DP
1. [P2362](https://www.luogu.com.cn/problem/P2362)
1. [P1203](https://www.luogu.com.cn/problem/P1203)
1. [P2008](https://www.luogu.com.cn/problem/P2008)
1. [P8707](https://www.luogu.com.cn/problem/P8707)
1. [P1002](https://www.luogu.com.cn/problem/P1002)
1. [P1130](https://www.luogu.com.cn/problem/P1130)
1. [P1216](https://www.luogu.com.cn/problem/P1216)
1. [P1115](https://www.luogu.com.cn/problem/P1115)
1. [P1359](https://www.luogu.com.cn/problem/P1359)
1. [P8395](https://www.luogu.com.cn/problem/P8395)
1. [P2837](https://www.luogu.com.cn/problem/P2837)
1. [P1968](https://www.luogu.com.cn/problem/P1968)
1. [P1796](https://www.luogu.com.cn/problem/P1796)
1. [P2800](https://www.luogu.com.cn/problem/P2800)
1. [P3009](https://www.luogu.com.cn/problem/P3009)
1. [P7158](https://www.luogu.com.cn/problem/P7158)
1. [P1569](https://www.luogu.com.cn/problem/P1569)
1. [P1057](https://www.luogu.com.cn/problem/P1057)
1. [P1970](https://www.luogu.com.cn/problem/P1970)
1. [P3399](https://www.luogu.com.cn/problem/P3399)
1. [P1103](https://www.luogu.com.cn/problem/P1103)
1. [P1388](https://www.luogu.com.cn/problem/P1388)
1. [P1140](https://www.luogu.com.cn/problem/P1140)
1. [P1481](https://www.luogu.com.cn/problem/P1481)
1. [P2028](https://www.luogu.com.cn/problem/P2028)
1. [P1233](https://www.luogu.com.cn/problem/P1233)
1. [P7074](https://www.luogu.com.cn/problem/P7074)
1. [P8814](https://www.luogu.com.cn/problem/P8814)
1. [P1977](https://www.luogu.com.cn/problem/P1977)
1. [P5888](https://www.luogu.com.cn/problem/P5888)
1. [P2359](https://www.luogu.com.cn/problem/P2359)
1. [P1799](https://www.luogu.com.cn/problem/P1799)
1. [P1650](https://www.luogu.com.cn/problem/P1650)
1. [P1651](https://www.luogu.com.cn/problem/P1651)

# 背包 DP
1. [P1507](https://www.luogu.com.cn/problem/P1507)
1. [P2663](https://www.luogu.com.cn/problem/P2663)
1. [P1855](https://www.luogu.com.cn/problem/P1855)
1. [P1910](https://www.luogu.com.cn/problem/P1910)
1. [P1510](https://www.luogu.com.cn/problem/P1510)
1. [P1048](https://www.luogu.com.cn/problem/P1048)
1. [P1049](https://www.luogu.com.cn/problem/P1049)
1. [P1060](https://www.luogu.com.cn/problem/P1060)
1. [P1164](https://www.luogu.com.cn/problem/P1164)
1. [P1734](https://www.luogu.com.cn/problem/P1734)
1. [P2347](https://www.luogu.com.cn/problem/P2347)
1. [P1926](https://www.luogu.com.cn/problem/P1926)
1. [P2430](https://www.luogu.com.cn/problem/P2430)
1. [P1877](https://www.luogu.com.cn/problem/P1877)
1. [P2639](https://www.luogu.com.cn/problem/P2639)
1. [P2925](https://www.luogu.com.cn/problem/P2925)
1. [P2871](https://www.luogu.com.cn/problem/P2871)
1. [P1616](https://www.luogu.com.cn/problem/P1616)
1. [P1679](https://www.luogu.com.cn/problem/P1679)
1. [P1832](https://www.luogu.com.cn/problem/P1832)
1. [P2722](https://www.luogu.com.cn/problem/P2722)
1. [P2918](https://www.luogu.com.cn/problem/P2918)
1. [P2904](https://www.luogu.com.cn/problem/P2904)
1. [P1853](https://www.luogu.com.cn/problem/P1853)
1. [P1509](https://www.luogu.com.cn/problem/P1509)
1. [P1504](https://www.luogu.com.cn/problem/P1504)
1. [P1077](https://www.luogu.com.cn/problem/P1077)
1. [P2340](https://www.luogu.com.cn/problem/P2340)
1. [P6771](https://www.luogu.com.cn/problem/P6771)
1. [P2725](https://www.luogu.com.cn/problem/P2725)
1. [P1833](https://www.luogu.com.cn/problem/P1833)
1. [P5662](https://www.luogu.com.cn/problem/P5662)
1. [P5365](https://www.luogu.com.cn/problem/P5365)
1. [P5322](https://www.luogu.com.cn/problem/P5322)
1. [P1156](https://www.luogu.com.cn/problem/P1156)
1. [P1776](https://www.luogu.com.cn/problem/P1776)

# 区间 DP

1. [P1775](https://www.luogu.com.cn/problem/P1775)
1. [P2858](https://www.luogu.com.cn/problem/P2858)
1. [P2426](https://www.luogu.com.cn/problem/P2426)
1. [P1063](https://www.luogu.com.cn/problem/P1063)
1. [P3147](https://www.luogu.com.cn/problem/P3147)
1. [P3146](https://www.luogu.com.cn/problem/P3146)
1. [P4170](https://www.luogu.com.cn/problem/P4170)
1. [P3205](https://www.luogu.com.cn/problem/P3205)
1. [P8675](https://www.luogu.com.cn/problem/P8675)
1. [P1622](https://www.luogu.com.cn/problem/P1622)

# 建图搜索

1. [P8605](https://www.luogu.com.cn/problem/P8605)
1. [P8604](https://www.luogu.com.cn/problem/P8604)
1. [P5318](https://www.luogu.com.cn/problem/P5318)
1. [P1330](https://www.luogu.com.cn/problem/P1330)
1. [P1294](https://www.luogu.com.cn/problem/P1294)
1. [P5663](https://www.luogu.com.cn/problem/P5663)
1. [P9751](https://www.luogu.com.cn/problem/P9751)

# 树形结构

1. [P1827](https://www.luogu.com.cn/problem/P1827)
1. [B3642](https://www.luogu.com.cn/problem/B3642)
1. [P1087](https://www.luogu.com.cn/problem/P1087)
1. [P1030](https://www.luogu.com.cn/problem/P1030)
1. [P1229](https://www.luogu.com.cn/problem/P1229)
1. [P2171](https://www.luogu.com.cn/problem/P2171)
1. [P2052](https://www.luogu.com.cn/problem/P2052)
1. [P8815](https://www.luogu.com.cn/problem/P8815)
1. [P2441](https://www.luogu.com.cn/problem/P2441)
1. [P5018](https://www.luogu.com.cn/problem/P5018)
1. [P7073](https://www.luogu.com.cn/problem/P7073)
posted @   RainCQwQ  阅读(44)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示