自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(81)
  • 资源 (1)
  • 收藏
  • 关注

原创 LM+retrieval

通过学习参数调节LM的输出概率和通过datasets得到与x相似度最近的句子(可以把句子滑动窗口切割)的概率分布,两者组合构成新的输出概率分布,以此来选择下一个字。主要是通过通过相似度计算或者重要性计算在datasets中得到与询问x最相关的k个document,讲文档放在询问x前面组成新的LM的输入,获取额外知识以回答问题。主要是将输入x截成多个小段xi,然后转化成对应emb向量,在模型中加入一层对上一层输出H和emb向量xi进行融合作为下一层新的输入,融入外部知识。

2023-08-09 14:17:51 116

原创 系统调用API

/__thread是GCC内置的线程局部存储设施,__thread变量每一个线程有一份独立实体,各个线程的值互不干扰。/与getpid()函数不同的是,Linux并没有直接给一个gettid()的API,//而是使用syscall()直接用SYS_gettid的系统调用号去获取线程号。//可以用来修饰那些带有全局性且值可能变,但是又不值得用全局变量保护的变量。//__builtin_expect作用是将“分支转移”的信息提供给编译器,//这样编译器可以对代码进行优化,以减少指令跳转带来的性能下降。

2023-04-26 15:29:57 133

原创 “弱回调”确保容器内存中始终是存活对象

弱回调

2022-12-11 21:49:34 175

原创 c++智能指针

c++

2022-12-09 22:25:26 122

原创 Linuxc/c++服务器编程

linux系统调用api

2022-11-12 22:01:13 121

原创 ACM退役贴

acm退役贴

2022-07-24 20:24:45 652 6

原创 2020ccpc绵阳站后记

经过了上次秦皇岛接近铜尾打铁后,又训练了两个礼拜,大家都不希望绵阳再打铁了,准备保铜冲铜,wk赛前说这次肯定排名肯定比148要高。事实证明他说的很有道理,比完赛143名,铜牌尾巴的尾巴,差点人就又被送走了。从结果来看达到了我们的期望,过程又是极度凶险。开场就发现了三分钟就发现了签到题,因为有人上场两分钟就wa了两发,我无话可说,只能说大家都是签到王者。ht上来冲签到题,冲到一半发现做法好像不对,“很自然”我说应该是二分,仔细一想确实。然后队友很快就wa了,然后比赛一开场就开始帮队友debug。我先讲了下我

2020-11-03 19:44:36 579 1

原创 2020年浙江省省赛赛后总结

按照我们对往年的省赛理解,应该是上来就是四五道签到题,银牌题估计也是个简单结论加实现和一些模拟题,最多再来点最短路的样子。感觉在今年参赛人数变多的情况下打银应该不难。但是今年的省赛确实是出乎了我们的意料。这是我们队的第一场比赛。疫情原因又变成了线上赛。后记写的有点迟,虽然才过了四天有些细节也记不太清了。现在回想起来就是因为pat的考试环境的榜和我们之前测试的都不一样,榜不是在排行榜那里显示,而是在链接里看,结果就是我们全程看不见榜,只能在题目过题人数和通过率那里找签到题。一开场强强的队友们就开始平稳签了到

2020-10-20 19:30:39 586

原创 Vases and Flowers HDU - 4614(思维 二分 线段树)

题目Alice有N个花瓶(标号为0~ N-1)。当她收到一些花时,她会随机的选择一个瓶子A,从它开始遍历A,A+1, A+2, …, N-1号瓶子,遇到空瓶子就放一朵花进去,直到花朵放完或没有瓶子,剩下的花将被丢弃。有时,她也会清理标号从A到B的花瓶(A <= B).花瓶里的花会被丢弃。Input第一行一个整数T,表示数据组数。每组数据,第一行一个整数N(1 < N < ...

2020-02-03 17:36:40 167

原创 Intervals ZOJ - 1508(差分约束系统)

题目You are given n closed, integer intervals [ai, bi] and n integers c1, …, cn.Write a program that:reads the number of intervals, their endpoints and integers c1, …, cn from the standard input,com...

2020-02-02 18:16:02 213

原创 Burn the Linked Camp ZOJ - 2770(差分约束系统)

题目It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. The defeat was due to Liu Bei’s wrong decision...

2020-02-01 18:31:59 151

原创 The Doors POJ - 1556(路径选择门边缘点思路详解 bellman_ford求最短路)

题目You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points ...

2020-01-31 19:44:49 224

原创 Arbitrage POJ - 2240(bellman_ford 判断正权环)

题目Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 Bri...

2020-01-30 18:43:05 168

原创 Dijkstra

(1)一般是单起点问题,操作步骤就是选择起点vis标记 然后更新距离数组d然后循环从d数组中选取最小值,作为新起点vis,更新数组d。重复n-1次。(2)多起点多终点问题 初始化将所有起点vis标记 然后更新距离数组d,类似最小生成树,把多起点化为一个起点。(3)如果是多起点唯一终点,可以转化成一般的单起点问题,逆向思考。也可以就按照(2)来做。以下是单起点的大概样子,具体情况具体改。...

2020-01-30 13:37:33 140

原创 Window Pains POJ - 2585(拓扑排序在覆盖问题中的运用)

题目Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its own window....

2020-01-29 19:09:39 186

原创 Sorting It All Out POJ - 1094(拓扑排序 关系实时判断)

题目An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D...

2020-01-29 17:15:59 141

原创 AOV网络、AOE网络(拓扑排序)

判断是否可构成AOV网络,即是否存在拓扑序列#include <cstdio>#include <cstring>#include <queue>using namespace std;int n, m;vector <int> p[110];int inde[110];int tp(){ queue<int> ...

2020-01-29 12:42:36 501

原创 Frogs' Neighborhood POJ - 1659(判读是否可图)

题目未名湖附近共有N个大小湖泊L1, L2, …, Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤ i ≤ N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1, x2, …, xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤ T ≤ 20)。每组数据包括两行,第一行是整数N(2 < N &...

2020-01-28 17:54:39 118

原创 Transformation HDU - 4578(区间值多重复值 线段树 lazy)

题目Yuanfang is puzzled with the question below:There are n integers, a 1, a 2, …, a n. The initial values of them are 0. There are four kinds of operations.Operation 1: Add c to each number between ...

2020-01-27 15:30:14 126

原创 Assign the task HDU - 3974(dfs序+线段树)

题目There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,th...

2020-01-23 18:43:54 123

原创 Tunnel Warfare HDU - 1540(线段树做法 (修改查询区间最大值最小值)or stl做法)

题目During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Excep...

2020-01-21 16:19:54 142

原创 数学期望与概率论 数论杂记

如果 N = p1^c1 * p2^c2 * … *pk^ck约数个数: (c1 + 1) * (c2 + 1) * … * (ck + 1)约数之和: (p1^0 + p1^1 + … + p1^c1) * … * (pk^0 + pk^1 + … + pk^ck)

2020-01-21 15:30:07 206

原创 C. NEKO's Maze Game(Codeforces Round #614 (Div. 2))

题目NEKO#ΦωΦ has just got a new maze game on her PC!The game’s main puzzle is a maze, in the forms of a 2×nrectangle grid. NEKO’s task is to lead a Nekomimi girl from cell (1,1) to the gate at (2,n)...

2020-01-20 14:55:47 175 1

原创 CodeForces - 803D. Magazine Ad(对答案二分)

题目主要城市杂志为读者提供发布广告的机会。 广告的格式应该是这样的:有空格分隔的非空字母的小写和大写字母。除此之外,字符串的中间有很多 ‘-’ 符号。现在要将字符串划为 k 行,每一行只能在空格或者 ‘-’ 后截断,现在问最长的一行最短长度是多少。Input第一行包含一个整数 k (1 ≤ k ≤ 105)。第二行包含一个字符串 — 只包含大小写字母,空格和 ‘-’ 符号。Outp...

2020-01-18 16:36:19 255

原创 Mahmoud and Ehab and the xor CodeForces - 862C(异或按位思维)

题目你现在有0…10^6这些数字供选择,让你组成一个大小恰好为n的整数集合,这个集合里面的数字各不不相同,且要求它们的异或和为x.如整数集合为{2,3,4,5},则它们的异或和的表达式就为2^ 3 ^ 4^5.Input第一行两个数字n和x.1<=n<=10^50<=x<=10^5Output如果没有这样的集合就只输出一行“NO”.否则,第一行输出"YES...

2020-01-15 18:34:50 287

原创 Andryusha and Colored Balloons CodeForces - 780C

题目C. Andryusha and Colored Balloonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha goes through a park each day. The squares a...

2020-01-15 15:53:17 200

原创 Wall Painting HDU - 4810(按位算贡献)

题目Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every day. Every day before painting, she produces a wonderful color of pigments by mixing water and some bags of pigments. On the...

2020-01-13 13:45:17 227

原创 Poor Warehouse Keeper HDU - 4803(思维)

题目Jenny is a warehouse keeper. He writes down the entry records everyday. The record is shown on a screen, as follow:There are only two buttons on the screen. Pressing the button in the first line o...

2020-01-12 19:49:25 132

原创 D - Ball HDU - 4811(思维)

题目Jenny likes balls. He has some balls and he wants to arrange them in a row on the table.Each of those balls can be one of three possible colors: red, yellow, or blue. More precisely, Jenny has R r...

2020-01-12 15:37:37 308

原创 HDU - 1698(区间修改,取件查询,lazy区间标记更新)

题意给你个大区间,区间上初始值皆为1,然后给出一系列修改操作,查询操作。修改操作可修改区间l~r上的值为k(1,2,3),查询操作问区间 l ~ r上的数值总和为多少。解释利用线段树,求和版本,但利用lazy标记,lazy只标记在符合更新的区间内的区间点。然后在query里写在向下更新前,进行pushdown的lazy更新。pushdown中利用lazy得到子节点的lazy值,同时为两个子...

2020-01-11 10:16:05 164

原创 HDU - 4352(数位dp+状态压缩+LIS)

题意求区间范围内最长上升子序列数位k的数字有多少个解释首先由数位dp引入思路,dp转移方程为:dfs(pos,…status.) = 累加dfs(pos-1,.stautselse…)可备忘录记录的dp数组为 dp[pos][status][k] ,之所以要备忘录k,是为了满足不同k的访问status记录的是开头数字到pos位置所选择的数字组合,通过二进制压缩状态为一个数字,二进制位数...

2020-01-10 18:38:09 267

原创 Round Numbers POJ - 3252(数位dp)

题目The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a host of other names) in order to m...

2019-12-16 21:10:21 162

原创 Bomb HDU - 3555(基础数位dp)

题目The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence ...

2019-11-24 20:32:14 136

原创 B-number(数位dp)

题目A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string “13” and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639...

2019-11-24 19:43:39 218

原创 吉哥系列故事――恨7不成妻 HDU - 4507(数位dp 加强)

题目单身!  依然单身!  吉哥依然单身!  DS级码农吉哥依然单身!  所以,他生平最恨情人节,不管是214还是77,他都讨厌!    吉哥观察了214和77这两个数,发现:  2+1+4=7  7+7=72  77=711  最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!什么样的数和7有关呢?如果一个整数符合下面3个条件之一,那...

2019-11-24 18:28:12 241

原创 Beautiful numbers CodeForces - 55D(数位dp)

题目Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue w...

2019-11-22 20:05:21 167

原创 String painter HDU - 2476(双重区间dp or 区间dp加dp)

题目 There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can change a segment of c...

2019-11-16 21:23:42 136

原创 You Are the One HDU - 4283(区间dp)

题目The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The show is hold in the Small hall, so it attract a lo...

2019-11-16 15:04:58 101

原创 Multiplication Puzzle POJ - 1651(区间dp)

题目The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the...

2019-11-14 21:09:08 214 2

原创 Coloring Brackets CodeForces - 149D(区间dp)

题目Once Petya read a problem about a bracket sequence. He gave it much thought but didn’t find a solution. Today you will face it.You are given string s. It represents a correct bracket sequence. A c...

2019-11-14 19:16:06 120

C语言Devc++果园作物管理系统源程序.zip

这是数据结构的大作业,就是类似学生管理系统,只不过对象改成了果园,相关功能实现的还可以,有登录功能,基本的增删查改功能,对树种,园地,收获以及金额统计功能都有统计。有需要者自取。

2020-04-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除