- 博客(643)
- 资源 (11)
- 问答 (3)
- 收藏
- 关注
原创 活跃变量分析
一个变量x∈Varx \in Varx∈Var在一个程序点u上是活跃的(live),如果存在某些从u到程序重点End路径中,包含一个对变量x的使用,且从程序点u到使用这个变量的路径上没有对x进行定义赋值。定义活跃变量的数据流方程如下:InnOutn−Killn∪GennInnOutn−Killn∪GennOutnBInisEndblock∪s∈s。
2025-10-31 00:25:36
1027
原创 cf Educational Codeforces Round 177 D. Even String
D. Even Stringtime limit per test2 secondsmemory limit per test 512 megabytesYou would like to construct a string s, consisting of lowercase Latin letters, such that the following condition holds:For every pair of indices i and j such that si=sjs_i=s_jsi
2025-08-04 13:32:12
573
原创 cf Educational Codeforces Round 177 C. Disappearing Permutation
C. Disappearing Permutationtime limit per test2 secondsmemory limit per test512 megabytesA permutation of integers from 1 to n is an array of size n where each integer from 1 to n appears exactly once.You are given a permutation p of integers from 1 to
2025-08-04 12:24:42
1120
原创 线性规划(4)
我们来看下原始问题和对偶问题之间的关系,假设我们有向量x满足原始问题,向量y满足对偶问题,这里我们要结合一下原始问题和对偶问题的条件。答案是可以的,不过要假设原始问题有一个最优解,即如果原始问题有一个最优解,那么对偶问题也有一个最优解,并且二者最优解的值是相同的。上面的不等式结论我们可以得到,如果你的原始问题有一个可行解,那么它的目标函数值不能小于任何对偶形式目标值,这个关系叫做。等于γ,就是我们原始问题的最优解,因此得证。中消去,最后,我们要得到这样的一个公式,即。,我们要对参数α设置合适的值,使得。
2025-07-03 13:42:39
630
原创 洛谷 P1901 发射站
某地有 N 个能量发射站排成一行,每个发射站 i 都有不相同的高度 Hi,并能向两边(两端的发射站只能向一边)同时发射能量值为 Vi的能量,发出的能量只被两边最近的且比它高的发射站接收。显然,每个发射站发来的能量有可能被 0 或 1 或 2 个其他发射站所接受。请计算出接收最多能量的发射站接收的能量是多少。第 2 到 N+1 行,第 i+1 行有两个整数 Hi和 Vi,表示第 i 个发射站的高度和发射的能量值。输出仅一行,表示接收最多能量的发射站接收到的能量值。然后计算每个接收塔接受的总和即可。
2025-03-10 10:21:09
237
原创 Continuous Batching 连续批处理
原始论文题目:Continuous Batching — ORCA: a distributed serving system for Transformer-based generative models关键词:Continuous Batching, iteration-level scheduling, selective batchingOrca系统又由几个关键组件组成:Endpoint,Scheduler,Execution Engine,Request Pool不同于那些通过多次迭代直到所
2025-01-27 17:19:40
1253
原创 uva 1354 Mobile Computing
天平全部由长度为1的木棍组成,木棍的每一端要么挂一个挂坠,要么挂另外一个木棍。例如,只有2两个砝码a和b的情况,且重量分别是1/3和2/3,那么木棍应该挂在前2/3处使得天平保持平衡。输入一个整数t,表示有多少个测试用例,然后是r和s,0<r<10, 1<=s<=6,接着是s行,每行表示砝码的重量1<=紫书例题,使用位运算标记砝码集合,然后将砝码集合按照二叉树的结构分隔成不同的左右两部分。房间中有一个天平,房间的宽度为r,有s个砝码,每个砝码的重量是。砝码的宽度忽略不计,且子天平可以相互重叠。
2025-01-26 23:56:35
319
原创 uva 11059 Maximum Product
设置mi[i]和ma[i]分别表示,以第i个数结尾时,最小乘积序列结果以及最大乘积序列结果是多少。给你一个数n,以及n个数,现在让你找出乘积最大的连续子序列,如果最大乘积不是正数,输出0.这样做是因为如果v[i]为负值,那么最大值可能会变成最小值,最小值可能会变成最大值。找出三者中最大的给ma[i],最小的给mi[i]即可。值的范围是[-10, 10] n的范围1到18。考虑第i个值v[i],有三种转移状态。数据范围很小,直接暴力也是可以的。
2025-01-17 10:54:28
223
原创 mlir 记录
在 MLIR 中,Bytecode 类是用于定义和处理字节码(bytecode)序列化和反序列化的模板类。MLIR 使用字节码来高效地存储和传输操作、类型和属性等信息。里面有String, ArrayAttr等定义在 MLIR 中,Bytecode 类是用于定义字节码序列化和反序列化的基础模板类。
2025-01-16 12:57:39
720
1
原创 线性规划(其它)
一个集合S⊆RnS⊆Rn是凸的(convex) 当∀xy∈Sλx1−λy∈S∀λ∈01∀xy∈Sλx1−λy∈S∀λ∈01。很基础的一个定义关于凸集有一些性质两个凸集相加的结果也是凸集(凸集相加指的是集合中对应的向量相加)凸集乘以一个系数α∈Rα∈R的结果也是凸集。
2024-11-12 11:38:50
545
原创 线性规划(3)
设A∈Rm×nb∈Rnxx1...xnTAxb是不相容的(inconsistent),当且仅当∃y∈Rm,有yTA0并且yTb0证明:构造增广矩阵Ab,并把该增广矩阵变成行阶梯形式Rd如果Axb是不相容的,那么在存在矩阵R中的第i行全为0,而对应第i行的d不为0.存在一个矩阵M有MAR并且Mbd,取R的第i行和M的第i行,取d的第i行,那么如果Axb是不相容的,我们假设yT。
2024-11-08 07:59:21
775
原创 线性规划(2)
Minimizez3x2ysubjectto⎩⎨⎧x2y2x−yxy≥4≤2≥0≥0花括号中的不等式组我们一般称之为system of linear inequalities。
2024-11-05 11:35:37
873
原创 线性规划(1)
Minimizez3x2ysubjecttox2y2x−yxy≥4≤2≥0≥0上面的minimize部分叫做使用上面不等式约束的范围中的值进行,叫做例如上面的x, y, z取1,1,4就是一个feasible solution所有feasible solution的集合叫做如果一个feasible solution得到了一个目标函数的最优值,那么叫做optimal solution。
2024-11-05 10:32:12
478
原创 cf Codeforces Round 888 E. Nastya and Potions
有n种药,每种药有可能使用其它几种已有的药进行合成且不会自己合成自己。给你c1到cn标识每种药的购买加个,其中有k种药p1到pk表示这k个药已经有了,而且无限供应。接下是n行,每行表示合成第i种药需要的其它药的下标。很简单很基础的记忆化搜索,每种药要么使用其它药合成,要么直接购买即可。最后输出n个整数,输出每种药获得的最少花销。
2023-08-25 00:35:26
367
原创 cf Educational Codeforces Round 141 D. Different Arrays
cf 141 d different arrays
2023-03-16 22:15:42
663
原创 cf Educational Codeforces Round 134 E. Prefix Function Queries
cf 134 e kmp自动机
2023-01-20 20:12:50
1834
原创 cf Educational Codeforces Round 134 C. Min-Max Array Transformation
cf 134 c
2023-01-15 14:05:36
469
原创 cf Educational Codeforces Round 127 E. Preorder
原题:E. Preordertime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a rooted tree of 2n−12^n−12n−1 vertices. Every vertex of this tree has either 0 children, or 2 children. All leaves
2022-05-29 14:49:44
275
原创 cf Educational Codeforces Round 127 D. Insert a Progression
原题:D. Insert a Progressiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence of nintegers a1,a2,…,ana_1,a_2,…,a_na1,a2,…,an. You are also given x integers 1,2,…,x.Yo
2022-05-29 13:45:50
263
原创 cf Educational Codeforces Round 127 C. Dolce Vita
原题:C. Dolce Vitatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTurbulent times are coming, so you decided to buy sugar in advance. There are n shops around that sell sugar: the i−thi-thi−th s
2022-05-29 12:44:45
297
原创 tvm tutorial (1.2)
紧接着上一篇实现了array packing对矩阵乘法进行优化的策略,接下来记录cache写回优化(block writing throung caching)cache的写回说头比较多,有两种情况,一种叫write back,另一种是write through,详细内容可以参考下面链接:https://blog.youkuaiyun.com/xingzhe22222/article/details/81988101矩阵C的写回操作也是跳跃式的,不利于...
2022-02-09 10:46:42
302
原创 tvm tutorial (1.1)
接着上次 tensor_expr_get_started.py 没记录完的部分继续剩下的代码如下,给出的样例是Nvidia GPU设备端的代码run_cuda = Falseif run_cuda: # Change this target to the correct backend for you gpu. For example: cuda (NVIDIA GPUs), # rocm (Radeon GPUS), OpenCL (opencl). tgt_gpu = tv
2022-02-08 13:26:09
1542
原创 tvm tutorials 记录(1)
第一篇文章记录了relay_quick_start.py文件中的内容,主要是展示了如何使用relay构建网络结构图,以及调用什么接口可以实现对网络进行编译优化并部署。接下来看一下tensor_expr_get_started.py这个文件,文件900多行,注释占了绝大部分,提供这个demo的作者人很实在。作者上来来了一段解释,原文如下:In this tutorial we will turn our attention to how TVM works with Tensor Expression
2022-02-03 19:32:01
1239
原创 tvm tutorials 记录(0)
个人学习tvm的笔记在tutorial目录下面有个get_started的目录,里面是很基础使用教程,就像目录说的一样,get start代码中的注释很多写的很清楚了,这里主要用于记录并扩充relay_quick_start完整源码如下,原始代码中使用的resnet18,这里我替换成了mobilenet,因为是在cpu上跑,使用Mobilenet会快一些。这里代码的目的就是加载一个mobilenet的网络模型,然后对网络模型进行计算图优化,得到优化后的图结构,并运行这个优化后的图。
2022-01-31 15:10:32
2225
原创 yolov3 论文笔记
原始论文中废话太多,文章主要参考csdn以及知乎上等博主的优秀博文总结得到参考:https://blog.youkuaiyun.com/qq_37541097/article/details/81214953https://zhuanlan.zhihu.com/p/76802514https://zhuanlan.zhihu.com/p/337383661backboneyolo v3的backbone 使用的是darknet53,如下图:其中每个convolutional层是由 conv + bn +
2021-10-05 14:26:16
1378
原创 cf Educational Codeforces Round E. Boring Segments
原题:E. Boring Segmentstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nsegments on a number line, numbered from 1 to n. The i-th segments covers all integer points from li to ri
2021-09-21 17:31:28
232
原创 cf Educational Codeforces Round D. Say No to Palindromes
原题:D. Say No to Palindromestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet’s call the string beautiful if it does not contain a substring of length at least 2 , which is a palindrome. Reca
2021-09-21 17:02:08
204
原创 yolov2 论文笔记
摘要部分real-time object detection system that can detect over 9000 object categories.之所以叫yolo 9000 是因为可以检测9000个目标。Using a novel, multi-scale training method the same YOLOv2 model can run at varying sizes, offering an easy tradeoff between speed and accura
2021-09-21 13:44:33
541
BRIEF算法论文 和CenSurE特征匹配 论文
2018-03-18
FAST特征点检测算法的两篇论文
2018-03-08
opengl开源库 freeglut2.8
2018-01-24
《应用随机过程概率模型导论》第十版答案 答案
2018-01-08
C++ 输出值后输出引用参数的函数值结果为什么是这样?
2016-08-27
VS2013 MFC程序如何自动选择数据源?
2017-08-26
c语言调用system命令执行cl test.cpp
2015-04-18
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅