1095: The 3n + 1 problem Python解法(25行简单易懂) 摘要:解题思路:注意事项: i,j的大小不确定的,要分类来做,我第一次就错了参考代码:while True: t = False m = [] a, b = map(int,i…… 题解列表 2021年04月15日 0 点赞 0 评论 756 浏览 评分:9.9
错误票据(c++,三种方法实现) 摘要:解题思路:这个输入需要一些技巧,首先,他给的N表示输入多少行,然后每一行到底输入多少个数字我们不知道,这就需要我们去判断输入的结尾是不是换行号,这里提供了一个C++的判断方法:cin.get()==&…… 题解列表 2021年04月15日 0 点赞 1 评论 868 浏览 评分:4.6
直接查找(Python) 摘要:S={}n=int(input())while n>0: t=int(input()) if t in S: S[t]=S[t]+1 else: S[t]…… 题解列表 2021年04月15日 0 点赞 0 评论 326 浏览 评分:0.0
蓝桥杯历届试题-蚂蚁感冒 摘要:```python num = int(input()) ls = list(map(int,input().split())) a = ls[0] sum = len(ls) co…… 题解列表 2021年04月15日 0 点赞 0 评论 452 浏览 评分:0.0
简单的分巧克力方法,放心看 摘要:解题思路:二分参考代码:#include <stdio.h> #include <algorithm> using namespace std; int h[100010]; int w[10…… 题解列表 2021年04月15日 0 点赞 0 评论 543 浏览 评分:9.0
c++解法(可读性强) 摘要:```cpp #include #include #include #include using namespace std; int main() { int n1,n2…… 题解列表 2021年04月15日 0 点赞 0 评论 381 浏览 评分:9.9
c++暴力解法(自写sort函数的第三个参数) 摘要:```cpp #include #include #include #include using namespace std; bool comp(vector a,vector…… 题解列表 2021年04月15日 0 点赞 0 评论 607 浏览 评分:9.9
菜鸡的题解007——等差数列 摘要:gcd(最小公约数)要记住(我是菜鸡,差点把冒号前后写错了)思路:用sort排序,然后依次从大到小求相邻数的差值,然后求这些差值的最大公约数,就是最大的公差(一定要注意不存在最大公约数的情况,即存在两…… 题解列表 2021年04月15日 0 点赞 0 评论 390 浏览 评分:0.0
菜鸡的题解006——特别数的和 摘要:没啥可说的了,这题也能当提高题?参考代码:#include<iostream> #include<cstdio> #include<algorithm> #include<string> #i…… 题解列表 2021年04月15日 0 点赞 0 评论 243 浏览 评分:0.0
优质题解 菜鸡的题解005——糖果 摘要:数位DP,动态规划(DP)的一种,在本题中表示为使用二进制表示糖果情况,第i位上为0代表第i种糖果不能吃到,为1则代表能吃到。用a[n]表示在二进制数为n时需要的最少糖果袋数,f[n]表示初始的n个糖…… 题解列表 2021年04月15日 0 点赞 0 评论 1195 浏览 评分:9.9