题目 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
package LeetCode_31 /** * 31. Next Permutation * https://leetcode.com/problems/next-permutation/description/ * Implement next permutation, which rearr ...
分类:
其他好文 时间:
2020-06-28 18:53:29
阅读次数:
51
题目链接:https://codeforces.com/contest/1359/problem/D 想法: 因为是减去最大值,我们可以考虑直接枚举最大值。 找到左边最后一个 小于等于a[i] 的位置,找到右边最后一个 小于等于a[i] 的位置 找到这样的一个子区间,然后我们利用ST表维护前缀和,找 ...
分类:
其他好文 时间:
2020-06-28 00:01:11
阅读次数:
80