Problem DescriptionBusinesses like to have memorable telephone numbers. One way to make a teleph
原创
2022-11-30 10:02:39
85阅读
考虑各种情况。。。#include #include #include #include #include #include #include #in
原创
2023-07-05 18:57:04
13阅读
When executing a SQL workload, you choose to generate execution plans only, without collecting execution statistics.Which two statements describe the
转载
2017-11-17 11:37:00
70阅读
2评论
题目大意:输入n代表样例数,每个样例输入m,代表m行电话号码,其中有些电话号码的字母需转化 。不存在则新建对应,值为1
原创
2021-12-01 16:19:19
73阅读
I.CF487E Tourists 用这题作圆方树的入门题还是很合适的。 首先,先建出圆方树出来。我们可以给方点赋一个权值,即为它连着的所有圆点的权值的$\min$。然后只需要在圆方树上查询路径$\min$即可。使用树剖即可。 但这个做法会被叉掉:当原图是一张菊花图时,花心的圆点将会连向$n-1$个
转载
2021-04-06 13:39:00
57阅读
题意:给你一个数组,现在让你分割这个数组,要求是数组每一块最少 L 个数 且 每一块中 极值 不超过 s
解题思路:
1)dp,从1 到 n 预处理左边的不能更新 离i 最近的点 ,然后线段树找出最小值。
2)当丑的人还在想着如何二分线段树,帅的人已经用STL解决了所有问题,可以用 STL 维护从左到右 极值 不超过 s的 最长连续段,第一次看到这么写。Orz。
解题代码:
1 // F
转载
2015-03-23 16:22:00
138阅读
题意:问一些7位数(可能有前导0,可到达100000个)是否有重复,将重复的按字典序从小到大输出并输出重复次数,没有的话输出“No duplicates.”。题目链接:http://poj.org/problem?id=1002——>>本来题目很水的,在刷后缀数组,中间有个基数排序的东西,于是用基数排序来做这题。。。#include #include #include using namespace std;const int maxn = 100000 + 10;int n, p[maxn][8], figure[maxn];int c[15], sa[maxn], fa[max
转载
2013-10-09 18:25:00
24阅读
2评论
用队列转移dp即可。。。#include using namespace std;typedef long long LL;#define mp(x, y) make_pair(x, y)const int maxn = 100005;int P[maxn];int a[maxn];int dp[maxn];int st1[maxn][20];int st2[maxn][
原创
2023-07-05 19:52:36
30阅读
ubmissions: 242236 Accepted: 42954DescriptionBusinesses like to have memorable telephone numbers. One way to make a...
原创
2023-07-19 16:02:07
44阅读
题面 题目大意: 给定一张 \(n\) 个点 \(m\) 条边的无向图,每个点都有权值 \(w_i\),要处理 $q$ 个操作 将某个点的权值修改 询问两点间路径中点的最小权值 $ 1\leq m,q,n \leq 105, 1\leq w_i\leq 109$ solution 知识点:圆方树 ...
转载
2021-07-26 09:53:00
40阅读
想看更多算法题,可以扫描上方二维码关注我微信公众号“数据结构和算法”,截止到目前我已经在公众号中更新了500多道算法题,其中部分已经整理成了pdf文
原创
2021-01-04 22:15:39
40阅读
#include <iostream>#include<string>#include<map>using namespace std;char mapping(char ch){ if(ch=='A'||ch=='B'||ch=='C')ch='2'; else if(ch=='D'||ch=='E'||ch=='F')ch='3'; else if(ch=='G'||ch=='H'||ch==
转载
2011-07-17 23:30:00
29阅读
原题链接 考察:枚举+二分 思路: 枚举其他两个药品的使用量,二分最后的使用量 ##Code #include <iostream> #include <cstring> #include <cmath> #include <vector> using namespace std; typedef
转载
2021-07-27 21:20:00
98阅读
2评论
题目链接:传送门一道纯纯的码农题当然也是也要动脑子的不然没有
原创
2022-10-25 14:52:01
49阅读
注意暴力的上届不要取小了。。。还有暴力的zi
原创
2023-07-05 18:56:56
43阅读
You can nearly always enjoy something if you make up your mind firmly that you will.
只要你下定决心做某件事,总能从中找到乐趣。
问题描述
给定一个字符串S,检查是否能重新排布其中的字母,使得两相邻的字符不同。
若可行,输出任意可行的结果。若不可行,返回空字符串。
示例 1:
输入: S = "aab"
输出
原创
2021-06-12 00:07:53
1325阅读
题目 题目链接:https://codeforces.com/problemset/problem/487/E Cyberland 有 n 座城市,编号从 1 到 n,有 m 条双向道路连接这些城市。第 j 条路连接城市 aj 和 bj。每天,都有成千上万的游客来到 Cyberland 游玩。 在每
转载
2021-01-25 11:16:00
108阅读
2评论
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 306973 Accepted: 54856 Description Businesses like to have memorable telephone num
转载
2018-06-17 10:09:00
363阅读
2评论
http://www.elijahqi.win/archives/1355 Alexandra has a paper strip with n numbers on it. Let’s call them ai from left to right.Now Alexandra wants to split it into some pieces (possibly 1). For each...
原创
2022-08-08 13:33:54
88阅读
A. A Blend of Springtime(暴力/模拟) 题目大意 给出$n$个花,每个点都有自己的颜色,问是否存在连续大于等于三个花颜色均不相同 sol 直接模拟判断即可 #include<cstdio> #include<cstring> using namespace std; cons
原创
2021-06-04 19:37:28
127阅读