编写题解 2002: 计算数字个数(Python) 摘要:解题思路:题解一:通过遍历字符串判断字符是否为数字参考代码:n=input() s1=0 for i in n: if i.isdigit(): s1+=1 prin…… 题解列表 2024年03月05日 0 点赞 0 评论 336 浏览 评分:0.0
平方差python解 摘要:解题思路:只有当x为奇数或4的倍数时才能拆分为两个数的平方差。注意事项:x-(x//2)求奇数的个数x//4求4的倍数的个数为了计算范围 [L, R] 内满足条件的数目,减去 f(L-1) 的目的是排…… 题解列表 2024年03月05日 0 点赞 1 评论 534 浏览 评分:6.0
动态规划 最长公共子序列 摘要:解题思路:注意事项:参考代码:a = list(input()) b = list(input()) la = len(a) lb =len(b) dp=[[0 for i in range(…… 题解列表 2024年03月05日 0 点赞 0 评论 507 浏览 评分:0.0
暴力法,蓝桥杯2020年第十一届省赛真题-回文日期 摘要:解题思路:注意事项:参考代码:from datetime import timedelta, datetime def pan1(day): for i in range(4): …… 题解列表 2024年03月05日 0 点赞 0 评论 395 浏览 评分:9.9
滑动窗口+优先队列 Python解法 简洁写法 摘要:可以先把Leetcode上面这题写了[滑动窗口最大值](https://leetcode.cn/problems/sliding-window-maximum/submissions/50760610…… 题解列表 2024年03月04日 0 点赞 0 评论 855 浏览 评分:7.2
编写题解 2832: 第n小的质数 摘要:解题思路:注意事项:参考代码:from math import sqrtimport mathn=int(input())c=[2]num=1while num<=n: for i in ran…… 题解列表 2024年03月04日 0 点赞 0 评论 300 浏览 评分:0.0
一行输入,简单简单入门 摘要:解题思路:注意事项:参考代码:three_list = [list(map(int, input().split())) for _ in range(3)]for i in range(3): …… 题解列表 2024年03月04日 0 点赞 0 评论 309 浏览 评分:9.9
编写题解 2831: 画矩形 摘要:解题思路:注意事项:参考代码:h,w,c,flag=map(str,input().split())h=int(h)w=int(w)flag=int(flag)if flag==1: for i…… 题解列表 2024年03月04日 0 点赞 0 评论 257 浏览 评分:0.0
编写题解 2830: 数字统计 摘要:解题思路:注意事项:参考代码:l,r=map(int,input().split())times=0for i in range (l,r+1): times+=str(i).count(…… 题解列表 2024年03月04日 0 点赞 0 评论 308 浏览 评分:0.0
编写题解 2829: 数1的个数 摘要:解题思路:注意事项:参考代码:n=int(input())times=0for i in range (1,n+1): times+=str(i).count('1')print…… 题解列表 2024年03月04日 0 点赞 0 评论 351 浏览 评分:0.0