python-新生舞会 摘要:解题思路:开始想的是用对象解决,但是查询遍历的时间复杂度将达到O(n2),想想便放弃了,然后采用字典的方法,时间复杂度为O(n)。建立两个字典第一个字典键值为名字,值为性别第二个字典键值为学号,值为性…… 题解列表 2022年01月24日 0 点赞 0 评论 393 浏览 评分:0.0
Benjam1n:蓝桥杯算法提高VIP-铺地毯(Java代码) 摘要:# 铺地毯(Java) **为了不判断所有点的铺地毯情况,而只判断题中所求点(即代码中的x、y)的铺地毯情况,我们采取先读取所有坐标及长度后再判断而非边读取边判断。时间复杂度O(n),空间复杂度…… 题解列表 2022年01月24日 0 点赞 0 评论 445 浏览 评分:9.9
A+B for Input-Output Practice (V) 摘要:解题思路:两层for循环,用数组存储相加所需数字注意事项:参考代码:#include<iostream>using namespace std;int main(){ int row, n;//row…… 题解列表 2022年01月24日 0 点赞 0 评论 271 浏览 评分:0.0
2189: diamond(python代码) 摘要:解题思路:注意事项:参考代码:n = int(input()) m = 1 for i in range(n//2): print(' '*((n-m)//2)+'…… 题解列表 2022年01月24日 0 点赞 0 评论 277 浏览 评分:0.0
2190: Little Ke's problem 摘要:解题思路:注意事项:参考代码:n = input() print(f"What is your name? Hello {n}, nice to meet you.")…… 题解列表 2022年01月24日 0 点赞 0 评论 334 浏览 评分:0.0
python-矩阵加法 摘要:解题思路:注意事项:注意题目要求最后一行不要有多余空格参考代码:def f(n,m): A = [[int(j) for j in input().strip().split()] fo…… 题解列表 2022年01月24日 0 点赞 0 评论 444 浏览 评分:0.0
2191: Little Xie's issue(python代码) 摘要:解题思路:注意事项:参考代码:n = input() print('*'*(len(n)+4)) print('* '+n+' *') print…… 题解列表 2022年01月24日 0 点赞 0 评论 370 浏览 评分:0.0
【编程入门】迭代法求平方根-题解(python) 摘要:解题思路: 根据所给公式写出相应代码,因为要迭代,所以利用python复合赋值。注意事项: 格式化输出保留三位小数。参考代码:x = int(input())a = x/2b = (a+x/a…… 题解列表 2022年01月24日 0 点赞 0 评论 442 浏览 评分:8.0
蓝桥杯历届试题-回文数字 (暴力查找)C++代码。 摘要:解题思路: 在main()函数里输入N,和循环查找,在AA()函数中判断是否为回文数字,在BB()函数中判断,某个数字的所有位的和,是否等于输入的数字N;设置一个计数变量看是否没有满足条件的,输出:…… 题解列表 2022年01月24日 0 点赞 0 评论 345 浏览 评分:6.7
[编程入门]自定义函数之字符类型统计 (C++代码) 摘要:解题思路:用string格式保存题目信息比用数组保存更简单一些注意事项:需要导入string库参考代码:#include<iostream>using namespace std;#include<s…… 题解列表 2022年01月24日 0 点赞 0 评论 342 浏览 评分:0.0