题解列表
dp和dfs两种解法(java)
摘要:参考代码:import java.util.*;public class Main { static int n; static int[][]g=new int[26][26]; static in……
java两种方式题解 动态规划、深度搜索(题目测试数据有坑,输入数据中有大于n的数据,会导致数组越界)
摘要:
import java.util.*;
public class Main { //1567
public static void main(String[] args) {……
蓝桥杯2023年第十四届省赛真题-冶炼金属
摘要:#include<iostream>
using namespace std;
const int MAX_N = 1e4 + 1; // 规定数据范围不超
int N, A[MAX_N], B……
编写题解 2966: 最大质因子序列
摘要:解题思路:先找因数,在判断是不是质数。注意事项:参考代码:#include <stdio.h>#include <math.h>int yinshu(int c){ for (int i = 1; i……
信息学奥赛一本通T1331-后缀表达式的值-Python
摘要:解题思路:定义一个Stack和对应的push和pop方法,然后将数字全部push进栈,然后根据操作符来eval计算,最后将结果pop出来。注意事项:参考代码:class Stack:
def……
奖学金,结构体,冒泡排序,有注释
摘要:#include
typedef struct date{
int number;
int chin;
int math;
int eng;
int tot;
}Date;……
2775: 等差数列末项计算python题解
摘要:解题思路:等差数列通项公式注意事项:先算公差参考代码:a1, a2, n = map(int, input().split())
d = a2-a1
an = a1+(n-1)*d
print(……
编写题解 2845: 求10000以内n的阶乘
摘要:解题思路:注意事项:参考代码:import java.util.Scanner;
import java.math.BigInteger;
public class Main {
……