题目 https://www.luogu.com.cn/problem/P3370 思路 大致的方法就是先自己预定一个base基值,将字符串的每一位与base相乘,解决冲突的方法就是使用自然溢出、双哈希等 代码 自然溢出 #include<iostream> #include<cstdio> #in ...
分类:
其他好文 时间:
2020-06-28 22:37:23
阅读次数:
55
题目 https://www.luogu.com.cn/problem/P1102 思路 使用一个map记录一样的数字出现的次数,使用另外一个map记录数字来寻找比自己大c和小c的数字 7 10 与10 7都算,最后整体除以2就行 代码 #include<iostream> #include<cst ...
分类:
其他好文 时间:
2020-06-28 22:26:58
阅读次数:
71
题目 https://www.luogu.com.cn/problem/P2814 思路 我们跨一使用string类型的map直接进行并查集! 注意这种形式的map的初始化!! 代码 #include<iostream> #include<cstdio> #include<string> #incl ...
分类:
其他好文 时间:
2020-06-28 22:21:52
阅读次数:
51
[codeforces 1335C] Two Teams Composing 统计技能种类数量+统计同一技能最大数量 https://codeforces.com/contest/1335/problem/C 7 4 2 4 1 4 3 4 统计技能种类数量 4种不同技能 统计同一技能最大数量 技能 ...
分类:
其他好文 时间:
2020-06-28 22:18:27
阅读次数:
90
题目 https://www.luogu.com.cn/problem/P5250 思路 使用set在寻找合适的木头的时候使用二分,但是一个set使用好像不能同时使用lower_bound(a)与lower_bound(a,greater<int>())? 于是菜菜的使用lower_bound找到大 ...
分类:
其他好文 时间:
2020-06-28 22:11:35
阅读次数:
62
[USACO10MAR]Great Cow Gathering G 换根dp模板题。 同时记录$sz[u]$代表$u$的子树内有多少奶牛,那转移时即为$dp[u]=dp[v]+sz[v] \times val(u,v)$。 注意开long long。 #include <bits/stdc++.h> ...
分类:
其他好文 时间:
2020-06-28 22:09:00
阅读次数:
49
LeetCode 0700. Search in a Binary Search Tree二叉搜索树中的搜索【Easy】【Python】【二叉树】 Problem LeetCode Given the root node of a binary search tree (BST) and a val ...
分类:
编程语言 时间:
2020-06-28 20:49:28
阅读次数:
61
题目链接: 原题:http://codeforces.com/problemset/problem/1070/A 翻译过的训练题:https://vjudge.net/contest/361183#problem/A 题目大意: 给你两个正整数p和x,让你求出最小的正整数m,满足m被p整除且m的各数 ...
分类:
其他好文 时间:
2020-06-28 20:38:58
阅读次数:
51
LeetCode 0450. Delete Node in a BST 删除二叉搜索树中的节点【Medium】【Python】【二叉树】 Problem LeetCode Given a root node reference of a BST and a key, delete the node ...
分类:
编程语言 时间:
2020-06-28 20:37:59
阅读次数:
51
LeetCode 0701. Insert into a Binary Search Tree 二叉搜索树中的插入操作【Medium】【Python】【二叉树】 Problem LeetCode Given the root node of a binary search tree (BST) an ...
分类:
编程语言 时间:
2020-06-28 20:34:28
阅读次数:
44