Kruskal 求最小生成树+ 并查集 摘要:解题思路: 看不加码头能不能构成最小生成树,如果不可以,则答案为加上码头和建路的最小生成树, ,,,如果可以,则在不加码头和 加上码头的最小生成树取最小值注意事项:建议把初始化码头和把码头的边加…… 题解列表 2022年11月25日 0 点赞 0 评论 464 浏览 评分:9.9
出圈(约瑟夫环)问题---用C语言解决 摘要:```c #include int main(void) { int n,m; while(scanf("%d%d", &n,&m)!=EOF) { int row[n]; …… 题解列表 2022年11月25日 0 点赞 0 评论 740 浏览 评分:9.9
2771: 大象喝水 摘要:解题思路:注意事项:参考代码:import math h,r = map(int,input().strip().split()) v = math.pi * h * r**2 print(mat…… 题解列表 2022年11月24日 0 点赞 0 评论 686 浏览 评分:6.0
超简单的C++ 摘要:参考代码:#include<iostream> using namespace std; int main() { long long int sum; long long …… 题解列表 2022年11月24日 0 点赞 0 评论 451 浏览 评分:9.9
N进制的加,C语言 摘要: #include #include #define N 10// 进制数 #define M '9'// 进制数 - 1 void reverse(char* c, int l, i…… 题解列表 2022年11月24日 0 点赞 0 评论 419 浏览 评分:9.9
无符号数的好处,省去负数讨论 摘要: 要点以下两点 #include int main() { int arr[32] = {0}; unsigned int n, index = 0;// 第一点 sca…… 题解列表 2022年11月24日 0 点赞 0 评论 396 浏览 评分:0.0
1866: 三位数反转 摘要:解题思路:注意事项:参考代码:while True: try: a = int(input()) b = a // 100 s = (a - b * 1…… 题解列表 2022年11月24日 0 点赞 5 评论 674 浏览 评分:6.0
简单易懂,两个函数给出答案 摘要:解题思路:先用compare函数对比出三个字符串的大小,再用compute函数排出次序。注意事项:1. compare函数返回的是一个数组指针,所以必须将其声明为一个指针函数。参考代码:#includ…… 题解列表 2022年11月24日 0 点赞 0 评论 305 浏览 评分:0.0
1173: 计算球体积 摘要:解题思路:注意事项:参考代码:import mathwhile True: try: r = float(input()) pi = math.pi …… 题解列表 2022年11月24日 0 点赞 0 评论 506 浏览 评分:0.0
现学现卖系列,c语言,动态空间分配,较为正规的解法!!! 摘要:解题思路:运用动态空间的开辟与分配来解决问题。注意事项:注意m,n,之间的数量关系参考代码:#include<stdio.h> #include<stdlib.h> int main() { …… 题解列表 2022年11月24日 0 点赞 0 评论 279 浏览 评分:9.9