对标 CSP-J/S 2025/2026 考纲
C++ 题库中心
逐字符检测 · 实时反馈 · 涵盖 CSP-J/S 全部知识点
0
全部题目
0
入门
0
基础
0
中档
0
提高
0
真题冲刺
16
提高
DFS全排列
递归与搜索
#include <iostream>
using namespace std;
int n, path[10];
bool used[10] = {false};
void dfs(int depth) {
if (depth...
16
提高
DFS组合枚举
递归与搜索
#include <iostream>
using namespace std;
int n, m, path[10];
void dfs(int depth, int start) {
if (depth == m) {
...
17
提高
BFS走迷宫
递归与搜索
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;
int n, m;
char g[105][105];
int dist[105][...
17
提高
BFS层序遍历二叉树
递归与搜索
#include <iostream>
#include <queue>
using namespace std;
struct Node {
int val;
Node *left, *right;
};
void l...
18
提高
爬楼梯问题
动态规划DP
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int dp[50];
dp[1] = 1; dp[2] = 2...
18
提高
最长上升子序列(LIS)
动态规划DP
#include <iostream>
using namespace std;
int main() {
int n, a[1005], dp[1005];
cin >> n;
for (int i = 1; i...
18
提高
数字三角形
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, a[105][105], dp[105][105];
ci...
19
提高
01背包问题
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, w[100], v[100];
int dp[100...
19
提高
完全背包问题
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, w[100], v[100];
int dp[100...
20
提高
Dijkstra最短路
图论
#include <iostream>
#include <cstring>
using namespace std;
const int INF = 0x3f3f3f3f;
int g[101][101], dist[101];
boo...
20
提高
Floyd最短路
图论
#include <iostream>
#include <cstring>
using namespace std;
const int INF = 0x3f3f3f3f;
int d[101][101];
int main() {
...
21
提高
二叉树前中后序遍历
树结构
#include <iostream>
using namespace std;
struct Node {
int data;
Node *left, *right;
};
void preOrder(Node* ro...
18
提高
辗转相除法求GCD
基础数论
#include <iostream>
using namespace std;
int gcd(int a, int b) {
while (b) {
int t = a % b;
a = b;
...
18
提高
快速幂
基础数论
#include <iostream>
using namespace std;
long long qpow(long long a, long long b, long long mod) {
long long res = ...
16
提高
DFS全排列
递归与搜索
#include <iostream>
using namespace std;
int n, path[10];
bool used[10] = {false};
void dfs(int depth) {
if (depth...
16
提高
DFS组合枚举
递归与搜索
#include <iostream>
using namespace std;
int n, m, path[10];
void dfs(int depth, int start) {
if (depth == m) {
...
17
提高
BFS走迷宫
递归与搜索
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;
int n, m;
char g[105][105];
int dist[105][...
17
提高
BFS层序遍历二叉树
递归与搜索
#include <iostream>
#include <queue>
using namespace std;
struct Node {
int val;
Node *left, *right;
};
void l...
18
提高
爬楼梯问题
动态规划DP
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int dp[50];
dp[1] = 1; dp[2] = 2...
18
提高
最长上升子序列(LIS)
动态规划DP
#include <iostream>
using namespace std;
int main() {
int n, a[1005], dp[1005];
cin >> n;
for (int i = 1; i...
18
提高
数字三角形
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, a[105][105], dp[105][105];
ci...
19
提高
01背包问题
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, w[100], v[100];
int dp[100...
19
提高
完全背包问题
动态规划DP
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, w[100], v[100];
int dp[100...
20
提高
Dijkstra最短路
图论
#include <iostream>
#include <cstring>
using namespace std;
const int INF = 0x3f3f3f3f;
int g[101][101], dist[101];
boo...