题解列表
十-八进制转换(动态栈、数组实现,作代码记录用)
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>typedef struct{ int *data……
[信息学奥赛一本通T1503-道路和航线] - 连通块+Dijkstra+拓扑排序(或者SPFA加一些优化,SLF,LLL,DFS这些)
摘要:## 方法一:DFS求连通块+块内Dijkstra+拓扑排序tip: 用SPFA只能大部分```cpp#include// #define int long long // memse……
堆栈的使用(动态栈、数组实现,作代码记录用,注意输入读取及输出的格式)
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>typedef struct{ int *data……
常规解法使用map函数
摘要:解题思路:使用map函数注意事项:输入字符类型为float参考代码:x,a,b,c,d=map(float,input().split())fx=a*x**3+b*x**2+c*x+dprint(……
分解质因数 一种用素数判断 一种无需判断
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;//判断是否是素数bool check(int ……
Python代码-8除不尽的数
摘要:```pythondef check(n): if n % 8 == 1: if (n//8) % 8 == 1: if (n//8//8) ……
Python代码-报数问题
摘要:```pythonfrom collections import dequeif __name__ == '__main__': n = int(input()) qu……
Python代码-求矩阵的两对角线上的元素之和
摘要:```pythonif __name__ == '__main__': N = int(input()) nums = [] for i in range(N):……