直接查找(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 评论 459 浏览 评分:0.0
蓝桥杯历届试题-蚂蚁感冒 摘要:```python num = int(input()) ls = list(map(int,input().split())) a = ls[0] sum = len(ls) co…… 题解列表 2021年04月15日 0 点赞 0 评论 604 浏览 评分:0.0
简单的分巧克力方法,放心看 摘要:解题思路:二分参考代码:#include <stdio.h> #include <algorithm> using namespace std; int h[100010]; int w[10…… 题解列表 2021年04月15日 0 点赞 0 评论 577 浏览 评分:9.0
c++解法(可读性强) 摘要:```cpp #include #include #include #include using namespace std; int main() { int n1,n2…… 题解列表 2021年04月15日 0 点赞 0 评论 436 浏览 评分:9.9
c++暴力解法(自写sort函数的第三个参数) 摘要:```cpp #include #include #include #include using namespace std; bool comp(vector a,vector…… 题解列表 2021年04月15日 0 点赞 0 评论 664 浏览 评分:9.9
菜鸡的题解007——等差数列 摘要:gcd(最小公约数)要记住(我是菜鸡,差点把冒号前后写错了)思路:用sort排序,然后依次从大到小求相邻数的差值,然后求这些差值的最大公约数,就是最大的公差(一定要注意不存在最大公约数的情况,即存在两…… 题解列表 2021年04月15日 0 点赞 0 评论 532 浏览 评分:0.0
菜鸡的题解006——特别数的和 摘要:没啥可说的了,这题也能当提高题?参考代码:#include<iostream> #include<cstdio> #include<algorithm> #include<string> #i…… 题解列表 2021年04月15日 0 点赞 0 评论 282 浏览 评分:0.0
优质题解 菜鸡的题解005——糖果 摘要:数位DP,动态规划(DP)的一种,在本题中表示为使用二进制表示糖果情况,第i位上为0代表第i种糖果不能吃到,为1则代表能吃到。用a[n]表示在二进制数为n时需要的最少糖果袋数,f[n]表示初始的n个糖…… 题解列表 2021年04月15日 0 点赞 0 评论 1246 浏览 评分:9.9
2300题解——外卖店优先级 摘要:**题解分析:** `初始时时刻所有店的优先级都为0(最低)[用数组arr表示]` `每过1时刻:有订单的店arr[id-1] += 2*订单数(优先级+2);` `每一时刻的时候定义一数组ar…… 题解列表 2021年04月15日 0 点赞 0 评论 796 浏览 评分:9.9
菜鸡的题解004——修改数组 摘要:解题思路:并查集,按秩排序。记得数组开大一点,An的最大值在一百万左右(我只开了二十万,不知道咋就过了)参考代码:#include<iostream> #include<cstdio> #incl…… 题解列表 2021年04月15日 0 点赞 0 评论 339 浏览 评分:8.0