题目题意:给出了hashing的结果,而且是我们可以找到序列中数的顺序,进行拓扑排序,...
翻译 2023-06-27 10:27:44
109阅读
Given a hash table of size N, we can define a hash function (. Suppose that the linear probing is used to solve collisions, we can easily obtain the s
转载 2020-02-06 18:27:00
203阅读
Given a hash table of size N, we can define a hash function H(x)=x%N. Suppose that the linear probing is used to solve collisions, we can easily obtai
转载 2019-11-30 22:46:00
317阅读
2评论
Given a hash table of size N, we can define a hash function (. Suppose that the linear probing is used to solve collisions, we can easily obtain the s
转载 2019-05-29 21:22:00
78阅读
2评论
Given a hash table of size N, we can define a hash function (. Suppose that the linear probing is used to solve collisions, we can easily obtain the s
转载 2018-11-30 11:43:00
77阅读
2评论
  题目描述: 给定一个大小为N的哈希表,定义一个哈希函数H(x)=x%N,假设使用线性探测来解决冲突,我们可以很容易地获得给定输入数字序列的哈希表的状态。        但是,现在要求您解决相反的问题:从哈希表的给定状态重建输入序列。每当有多个选择时,总是取最小的数。  输入格式: 每个输入文件包含一个测试用例。
原创 2021-07-06 13:54:46
228阅读
题意:给你一个长度为n的字符串,选择不同的k个子序列的最小花费,花费为n减去子序列长度 思路: dp ,dp[i][j]代表以i结尾,长度为j的不同的子序列个数,注意去重,枚举前面如果末尾的单词一样就减去前面相同长度的贡献。 #include<bits/stdc++.h> using namespace std;
原创 2021-12-29 09:52:56
10000+阅读
"E2. String Coloring (hard version)" 首先我们要明确一点,最多只会出现26种颜色,因为当下字母 如果在后面 出现过,那么在 i 这个位置的最佳颜色选择即为先前确定的颜色。所以我们可以使用状态压缩来记录状态。
原创 2022-11-03 15:25:55
70阅读
\quadThe only difference between problems C1C1C1 and C2C2C2 is that all values in inpu
原创 2023-02-03 10:07:58
48阅读
#include#include#include#includeusing namespace std;typedef long long LL;const int maxn=10010;int maxd,t,tt;set sk;LL ans[maxn],v[maxn];LL gcd(LL a,LL b){ return b?gcd(b, a%b):a;}LL ge
原创 2022-08-05 15:30:37
21阅读
1001 Battle Over Cities - Hard Version 思路:暴力跑每一个点作为被侵
原创 2022-11-03 15:25:26
70阅读
BFS经典变形分析 总结了一下,发现BFS还是可以考得很难的。 主要有这些变式(会结合具体题目讲解): 1.多个起点 起点也就相当于之前我解释的丢在水里的那个石子(具体见博客BFS学习笔记ev1_BFS的概念),只是有很多石子而已。 也许你会像之前P1747 好奇怪的游戏的第一种思路一样,选择去调用 ...
转载 2021-09-21 17:12:00
81阅读
2评论
思路:用堆贪心,按照总数量为第一关键字,按照f为1的个数为第二关键字,大的在前面,贪心的取,每次更新堆就可以了,push进堆的时候尽量去掉为0的个数#include<bits/stdc++.h>using namespace std;//#define int long longint mp[2][200010];int a[200010];set<int>s;struct node{ int xx; node(int _X) { xx=_X; } b.
原创 2021-10-16 10:18:46
6507阅读
链接查看题意:你可以进行以下的无限次操作,操作1:s=s+s,操作2 删去s的最后一个字符,最后问长度为k的字符的最小字典序。思路:考虑贪心做法,我们贪心的维护前缀,如果当前遍历的值比循环节对应的位置大直接break ,如果小于,那么显然肯定是要选择的,然后把指针弄成1,如果刚好等于,我们就
原创 2021-12-28 17:55:24
3793阅读
https://vjudge.net/problem/UVA-12558 埃及分数问题 限制k个数不能使用
转载 2021-08-05 11:26:30
76阅读
H. Subsequences (hard version) 这个题目好难啊,根本就不知道怎么dp,看了题解,理解了好一会才会的。 首先dp[i][j] 表示前面 i 个字符,形成长度为 j 的不同子字符串的个数。 dp[i][j]=dp[i-1][j-1]+dp[i][j-1] 这个就是说这个字符
转载 2019-10-03 21:00:00
72阅读
2评论
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe only difference between easy and hard versions is the length of the string.Y...
原创 2021-09-06 14:22:48
191阅读
E2. Array and Segments (Hard version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe only difference between easy and hard v...
原创 2021-09-06 14:45:08
97阅读
F2. Flying Sort (Hard Version) 题目大意: 给你一个大小是n的序列,有两种操作可以进行: 选一个数字放在最前面 选一个数字放在最后面 这个序列可能含有相同的数字,问最少的操作让这个序列变成一个不递减的序列。 题解: 其实这个题目难度不大,思考一会就知道要怎么求,但是这个
转载 2020-09-07 16:49:00
178阅读
2评论
传送门如果想到了dpdpdp的话,这题就不难了。首先解决一个简单的问题,如何求出串aaa有多少不同的子序列???定义f[i][j]f[i][j]f[i][j]为以[1,i][1,i][1,i]的
原创 2022-02-08 13:41:16
22阅读
  • 1
  • 2
  • 3
  • 4
  • 5