自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

KylinCommander

计算机研究生菜鸡的自用博客

  • 博客(22)
  • 收藏
  • 关注

原创 移码的位扩展

0. Background​ The exponent part of the IEEE Floating-Point Representation is encoded in a biased form. During my design of the ALU for the floating point, I need to find a way to extend the biased form for one bit without change the actual value which it

2020-10-21 13:53:36 298

原创 浮点ALU开发实记

The Last two month I was working for a porject of my lab. And I am responsible for designing a Floating-point ALU module with Verilog. Due to its confidentiality, I can’t publish the original code of what I am doing right now(Or maybe forever). But the bu

2020-09-04 11:02:46 482

转载 Python使用format输出时还想输出‘{‘,‘}‘的方法

在字符串中要print的’{‘或者’}’,用‘{{’或者‘}}’来表示:例如 print("(a_Plus_b [{:>3d}] == a_Plus_b [{:>3d}]) ? {{a_Plus_b[{:>3d} -: 13],1'b0}} : a_Plus_b[{:>3d} -: 14];".format(i*step+13,i*step+12,i*step+12,i*step+13))下文是转载的关于format的具体用法:

2020-09-02 07:52:00 1040

原创 Shell语法简单入门

课程由阿里云大学免费提供0. 运行chmod +x <name>.sh./<name>.sh1. 变量赋值:直接赋值:A=aaaecho $AB="$A B"B='$A B'注意:1) 等号两边不能有空格; 2)单引号之间的内容原封不动地制定给了变量,双引号之间仅仅是取消了空格的作用,保留特殊符号的含义。命令的结果作为变量 :# 1.A=`date`echo $A# 2.B=$(ls -l)echo $B与其他变量或字符串组成新字

2020-08-29 10:14:49 140

原创 Vim 基础用法入门笔记

Configure your own Vimcd ~vim .vimrcKey mapnoremap a b​ nore means no recursion. remap a to b:map Q :q<CR>​ Map Q to :q and Enter.Other useful settingsset number : Show the number of line.set relativenumber: Show the relativenumber of line

2020-08-26 12:58:12 258

原创 Notes for The Missing Semester of Your CS Education(2020) provided MIT

This is the note that i took for the Class of the MIT : The Missing Semester of Your CS Education(2020).https://www.bilibili.com/video/BV1x7411H7wa/?p=11.ShellWhitespace seperates the arguments, if I need an argument as multiple words:1.Quote those w

2020-08-23 17:26:03 2147

原创 Verilog 编写注意事项

本人总结了一周的verilog编程中常遇到的一些问题,供自己避免下次再犯。{}表示信号的拼接,其中不能再有条件语句,同时其中也不可包含parameter,可以包含define过的文本9’b0这类声明方式不可采用()的算式得到结果,必须是个确定的数字...

2020-08-01 20:58:47 859

原创 KMP 算法

一、

2020-05-03 17:33:30 128

原创 Leetcode 10. 正则表达式匹配

本文仅仅记录自身代码的一步步演变过程,需要详细解答请前往官网查看一、 纯递归求解class Solution {public: bool Match(string &s,string &p,int start_s,int start_p){ int size_s = s.size(),size_p = p.size(),i = start_s, j =...

2020-05-02 11:46:05 108

转载 树状数组

树状数组 数据结构详解与模板(可能是最详细的了) 原创 ...

2020-04-27 22:04:01 159

原创 分块思想与计数排序

p465

2020-04-27 21:46:30 160

原创 快速幂算法(递归实现与循环实现)

一、问题描述(Leetcode 50. Pow(x, n))实现 pow(x, n) ,即计算 x 的 n 次幂函数。二、递归实现对于任意 X^n,如果n是偶数,可以由 X^(n/2) 的平方得到;如果n是奇数,可以先求得小于n的最大偶数的结果再多乘一个x即可;class Solution {public: double fastPow(double x, long long n...

2020-04-27 20:34:32 774

原创 PAT 甲 1057 Stack(30分) 分块思想与树形数组

一、题目描述tack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) ...

2020-03-30 09:46:19 114

原创 PAT甲 1064 Complete Binary Tree(30)

一、指针实现这题拿到手想都不想直接采用了指针实现的二叉树进行递归求解。但实际上却忽略了完全二叉树可以采用静态数组来实现的特点,代码量大大加大。在第二部分附上简便做法。#include<cstdio>#include<vector>#include<algorithm>#include<queue>#include<cmath>...

2020-03-19 18:56:40 76

原创 PAT 甲级 1103 Integer Factorization (30分) 动态规划解法 (附DFS解法参考代码)

一、题目描述The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any p...

2020-03-17 11:20:19 173

原创 动态规划模型——背包问题

一、01背包1.问题描述:有n件物品,每件物品重量w[i],价值c[i]。现有一个容量为V的背包,问如何选取物品放入背包,使得背包内物品的总价值最大。其中每种物品都只有一件。二、完全背包1.问题描述:有n件物品,每件物品重量w[i],价值c[i]。现有一个容量为V的背包,问如何选取物品放入背包,使得背包内物品的总价值最大。其中每种物品都无穷件。...

2020-03-13 12:14:33 534

原创 动态规划常见思路总结

当题目与序列或者字符串(记为A)有关时,可以考虑把状态设计成两种形式:1.令dp[i]表示以A[i]结尾(或开头)的XXXX。2.令dp[i][j]表示A[i]至A[j]区间的XXXX。XXXX为题目要求一般地,对于一个问题一维的dp不满足状态的无后效性,则需要考虑对状态进行升维,然后对其中的每一维采取下面的某一个表达:1.恰好为i2.前i在每一维的含义设置完毕后,dp数组的含义就可...

2020-03-12 19:27:49 211

原创 动态规划模型——最长回文子串

一、我的解法dp[i]表示以input[i]结尾的最长回文串长度。dp[i]可能是由dp[i-1]加上input[i]形成的,也可能是在dp[i-1]的基础上前面后面各加一个元素构成的。为了避免原序列前物元素可补的情况需先判断原序列起始位置。#include<cstdio>#include<iostream>#include<string>#inclu...

2020-03-12 16:02:37 86

原创 动态规划模型——最长公共子序列(LCS)

给定两个序列,求一个最长的子序列(子序列可以不连续)//最长公共子序列做法#include<cstdio>#include<vector>using namespace std;int LCS(vector<int>& A,vector<int>& B){//A为模板串,A,B下标从1开始 vector<vect...

2020-03-12 12:46:58 157

原创 动态规划模型——最长不下降子序列(LIS)

#include<cstdio>#include<vector>using namespace std;int LIS(vector<int>& input){ vector<int> dp;//dp[i]:以input[i]结尾的最长不下降子序列长度 int maxlength=-1; for(int i=0;i<inp...

2020-03-11 19:55:26 153

原创 空间复杂度O(1)的数组循环右移问题

一、较为常规直观的思路一个比较常规的想法是先从数列中选取一个元素提取出来,放入移位后的元素。再将新空出来的位置放入新的应该移入的元素,以此类推,最后将一开始提取出的元素放入最终的空位。但是这个做法有个问题,有些情况下(比如数组长6,需要右移2位)选取一个元素后,最终只将3个数放入了正确的位置。剩余三个数需要在重复一次上述操作才可以得到正确的结果。这是因为当数组长n与移位m的最大公因数不是1时,...

2020-03-07 18:42:46 731

原创 类C PAT甲乙刷题常见问题总结

一,数据类型范围 int 占4B 补码表示的范围为 [-2^31,2^31-1] (约为-2*10^9~2*10^9这个量级) 大于int 范围考虑使用unsigne int 或 long long //输入输出格式为%lld 常见10^10这个范围的两个数相加减就可能超过int这个范围。二,scanf printf输入输出 1. printf 输出字符串的问题 prin...

2020-02-15 11:08:22 191

空空如也

空空如也

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

TA关注的人

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