题解列表
蓝桥杯2022年第十三届省赛真题-重新排序
摘要:解题思路:前缀和和差分数组减少运算量注意事项:不要超时和使用long long参考代码:#include <iostream>
#include <vector>
#include <set>
……
nxn矩阵的两对角线上的元素之和
摘要:解题思路:对于nxn级矩阵求对角线的和,实际是选取主对角线及下标和为n-1的数组和同时减去中心数组的值注意事项:参考代码:#include<iostream>
using namespace std……
简单思路,附有注释,通俗易懂
摘要:```java
//package 蓝桥杯2022年第十三届决赛真题;
import java.util.Scanner;
public class Main {
private s……
题解 1095: The 3n + 1 problem
摘要:解题思路:注意事项:还得先比较输入的两个数的大小!!!参考代码#include<stdio.h>
int main()
{
int a,b,m,n,j,temp;
int su……
利用列表内置函数解决
摘要:解题思路:利用list函数count注意事项:参考代码:times = int(input())s = []for i in range(times): s += [j for j in map……
逆序数——python
摘要:解题思路:注意事项:参考代码:n = int(input())L = list(map(int,input().split()))s = 0while len(L)>1: a = L[0] ……
Fibonacci数列——递归
摘要:解题思路:注意事项:参考代码:def fb(n): if n == 1 or n == 2: return 1 else: return fb(n-1)+fb(……