对标 CSP-J/S 2025/2026 考纲

C++ 题库中心

逐字符检测 · 实时反馈 · 涵盖 CSP-J/S 全部知识点

0
全部题目
0
入门
0
基础
0
中档
0
提高
0
真题冲刺
123 道题目
17
请先登录
提高

BFS走迷宫

递归与搜索

#include <iostream> #include <queue> #include <cstring> using namespace std; int n, m; char g[105][105]; int dist[105][...
28行 7分0秒 BFS,迷宫,最
17
请先登录
提高

BFS层序遍历二叉树

递归与搜索

#include <iostream> #include <queue> using namespace std; struct Node { int val; Node *left, *right; }; void l...
18行 4分0秒 BFS,二叉树,
18
请先登录
提高

爬楼梯问题

动态规划DP

#include <iostream> using namespace std; int main() { int n; cin >> n; int dp[50]; dp[1] = 1; dp[2] = 2...
10行 3分0秒 DP,爬楼梯,斐
18
请先登录
提高

最长上升子序列(LIS)

动态规划DP

#include <iostream> using namespace std; int main() { int n, a[1005], dp[1005]; cin >> n; for (int i = 1; i...
13行 5分0秒 DP,LIS,最
18
请先登录
提高

数字三角形

动态规划DP

#include <iostream> #include <algorithm> using namespace std; int main() { int n, a[105][105], dp[105][105]; ci...
14行 5分0秒 DP,数字三角形
19
请先登录
提高

01背包问题

动态规划DP

#include <iostream> #include <algorithm> using namespace std; int main() { int n, m, w[100], v[100]; int dp[100...
12行 5分0秒 DP,01背包,
19
请先登录
提高

完全背包问题

动态规划DP

#include <iostream> #include <algorithm> using namespace std; int main() { int n, m, w[100], v[100]; int dp[100...
12行 5分0秒 DP,完全背包,
20
请先登录
提高

Dijkstra最短路

图论

#include <iostream> #include <cstring> using namespace std; const int INF = 0x3f3f3f3f; int g[101][101], dist[101]; boo...
21行 7分0秒 Dijkstra
20
请先登录
提高

Floyd最短路

图论

#include <iostream> #include <cstring> using namespace std; const int INF = 0x3f3f3f3f; int d[101][101]; int main() { ...
19行 6分0秒 Floyd,最短
21
请先登录
提高

二叉树前中后序遍历

树结构

#include <iostream> using namespace std; struct Node { int data; Node *left, *right; }; void preOrder(Node* ro...
22行 5分0秒 二叉树,遍历,前
18
请先登录
提高

辗转相除法求GCD

基础数论

#include <iostream> using namespace std; int gcd(int a, int b) { while (b) { int t = a % b; a = b; ...
12行 4分0秒 数论,GCD,辗
18
请先登录
提高

快速幂

基础数论

#include <iostream> using namespace std; long long qpow(long long a, long long b, long long mod) { long long res = ...
13行 5分0秒 数论,快速幂,位
23
请先登录
提高

带权并查集

并查集

#include <iostream> using namespace std; const int N = 100005; int fa[N], d[N]; int find(int x) { if (fa[x] == x) ...
25行 8分0秒 并查集,带权,路
24
请先登录
提高

Kruskal最小生成树

最小生成树

#include <iostream> #include <algorithm> using namespace std; const int N = 100005; int fa[N]; struct Edge { int u...
25行 8分0秒 最小生成树,Kr
25
请先登录
提高

Dijkstra堆优化

最短路径进阶

#include <iostream> #include <vector> #include <queue> using namespace std; typedef pair<int,int> PII; const int N = 10...
25行 8分0秒 最短路,Dijk
26
请先登录
提高

线段树 - 区间求和

线段树

#include <iostream> using namespace std; const int N = 100005; long long tree[N << 2]; int a[N]; void build(int rt, in...
30行 10分0秒 线段树,区间查询
27
请先登录
提高

字符串哈希

字符串哈希与KMP

#include <iostream> #include <string> using namespace std; typedef unsigned long long ull; const ull BASE = 131; const ...
22行 7分0秒 字符串哈希,Ra
29
请先登录
提高

单调栈 - 下一个更大元素

单调栈与单调队列

#include <iostream> #include <stack> using namespace std; const int N = 100005; int a[N], nxt[N]; int main() { int...
18行 7分0秒 单调栈,下一个更
29
请先登录
提高

单调栈 - 最大矩形面积

单调栈与单调队列

#include <iostream> #include <stack> #include <algorithm> using namespace std; const int N = 100005; int h[N]; int mai...
22行 8分0秒 单调栈,最大矩形
30
请先登录
提高

二分答案 - 木材切割

二分答案

#include <iostream> using namespace std; const int N = 100005; int a[N]; int main() { int n, k; cin >> n >> k;...
22行 8分0秒 二分答案,最大化
22
请先登录
真题冲刺

CSP-J 2022苹果分堆

历年真题

#include <iostream> using namespace std; int main() { int n; cin >> n; int day = 0, ans = 0; while (n >...
12行 6分0秒 真题,CSP-J
22
请先登录
真题冲刺

CSP-J 2021分糖果

历年真题

#include <iostream> using namespace std; int main() { int n, L, R; cin >> n >> L >> R; if (L / n == R / n) ...
10行 5分0秒 真题,CSP-J
22
请先登录
真题冲刺

CSP-J 2023一元二次方程

历年真题

#include <iostream> #include <cmath> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; ...
15行 6分0秒 真题,CSP-J
22
请先登录
真题冲刺

CSP-J 2022苹果分堆

历年真题

#include <iostream> using namespace std; int main() { int n; cin >> n; int day = 0, ans = 0; while (n >...
12行 6分0秒 真题,CSP-J
1... 3 4 5 6