自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

nucleare的博客

任何坚持梦想的人,都值得我们尊敬

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

原创 Build Tree HDU - 6533

http://acm.hdu.edu.cn/showproblem.php?pid=6533题目描述构建一个m层的满n叉树,所有的边都有权值。每条边的权值从k个数里面选,每个数只能被选一次0是根节点。di表示根节点到i点的距离,我们的目标是使得每个点到根节点的和最小。答案可能很大,请输出取模p后的答案输入输入包含两行第一行四个数,k,m,n,p (2<=k<=2e5 , 2<=p<=1e15)第二行包含k个数,保证k大于等于边数m,k个数每个.

2021-04-30 19:25:37 235 1

原创 QT 常用命令

Ctrl+B 编译工程Ctrl+R 运行工程Shift+F2 声明和定义之间切换F4 头文件和源文件之间切换F2 跳转到函数定义(和Ctrl+鼠标左键一样的效果)Ctrl(按住)+ Tab快速切换已打开的文件Ctrl + K 全局搜索按Alt +数字键(1-7)可以快速打开对应的输出窗口。Alt+0 显示或者隐藏左侧边条,编辑模式下起作用(有时写的函数太长,屏幕不够大,就用这个)Alt+Shift+0 ...

2021-01-09 10:53:33 1090

原创 在Linux的QT控制台工程中加入Lua

Linux安装Lua wget http://www.lua.org/ftp/lua-5.3.0.tar.gztar zxf lua-5.3.0.tar.gzcd lua-5.3.0make linux testmake install创建一个hellolua.lua文件:运行成功也可以:按CTRL + C退出 移植到QT工程 删除已经解压的lua-5.3.0重新解压tar zxf lua-5.3.0.tar.gzcd lua...

2021-01-09 10:33:07 361 1

原创 Linux常用命令

uname -r内核版本 -a全部cat /etc/issue 查看ubuntu版本touch 创建一个文件find 查找 -name -typetree 显示目录层级rmdir 删除目录ps 显示正在运行的进程 -aux -ef -ekill 终止进程cat 查看文件diff 比较两个文件scp 远程拷贝 scp -r name@ip:/pathname targetpathssh 远程登陆 ssh name@ip 要先下载安装打开ssh服务...

2020-12-17 09:59:52 112

原创 VIM常用命令

正常模式(:):n + 命令: 执行多次命令:w保存:wq-保存退出 ZZ:q-退出:q!不保存退出:e!放弃所有修改并重新载入该文件的原始内容。h左移一个字符l右移一个字符j下一行k上一行w 移动到上个word的首字符 be 移动到下个word的最后字符[n] G 移动到n行gg 移动到第一行G 移动到最后一行ctrl + f 下翻一屏ctrl + b 上翻一屏[n] dd 删除1[n]行d [h|l] 删除[左边|右边]一个字符要删除一个字符,只需...

2020-12-17 09:56:08 375

原创 内核子目录下的Makefile 文件

在内核源码的子目录中,几乎每个子目录都有相应的 Makefile 文件,管理着对应目录下的代码。对该目录的文件或者子目录的编译控制, Makefile 中有两种表示方式,一种是默认选择编译,用 obj-y 表示,如:obj-y += usb-host.o # 默认编译 usb-host.c 文件obj-y += gpio/ # 默认编译 gpio 目录另一种表示则与内核配置选项相关联,编译与否以及编译方式取决于内核配置,例如:obj-$(CONFIG_WDT) += wdt.o # wdt.c

2020-12-17 09:53:44 299

原创 实现一个platporm架构的LED驱动

目标:编写一个platporm架构的LED驱动参考知识:在Linux字符设备驱动编程模型中,只要应用程序open()了相应的设备文件,就可以使用ioctl通过驱动程序来控制我们的硬件,这种模型直观,但是从软件设计的角度看,却是一种十分糟糕的方式,它有一个致命的问题,就是设备信息和驱动代码冗余在一起,一旦硬件信息发生改变甚至设备已经不在了,就必须要修改驱动源码,非常的麻烦,为了解决这种驱动代码和设备信息耦合的问题,Linux提出了platform bus(平台总线)的概念,即使用虚拟总线将设备信息和驱

2020-12-17 09:47:57 367

原创 Linux下GPIO驱动

编写驱动程序,首先要了解是什么类型的设备。linux下的设备分为三类,分别为:字符设备,块设备和网络设备。字符设备类型是根据是否以字符流为数据的交换方式,大部分设备都是字符设备,如键盘,串口等,块设备则是以块为单位进行管理的设备,如,磁盘。网络设备就是网卡等。其次要了解应用程序和驱动程序的区别,两者的主要区别分为以下三点:1.入口函数的任务不相同,应用程序完成一个任务,驱动只完成初始化工作,比如中断申请,寄存器设置,定时器设置。2.运行时的cpu模式不相同,驱动具有很高的权限,应用程...

2020-12-17 09:35:15 849 1

原创 python 爬虫爬小说

https://blog.csdn.net/c406495762/article/details/78123502# -*- coding:UTF-8 -*-import requestsimport sysfrom bs4 import BeautifulSoupif __name__ == '__main__': head_url = 'https://www.biq...

2019-11-18 14:40:00 185

原创 Python P1424 小鱼的航程(改进版)

https://www.luogu.org/problemnew/show/P1424x, n = map(int, input().split())ans = (n//7)*5n %= 7while n > 0 : if x != 6 and x != 7 : ans += 1 x += 1 n -= 1print(ans*250)...

2019-06-22 15:36:49 2162

原创 Python P1008 三连击

https://www.luogu.org/problemnew/show/P1008a = []b = []for i in range(0, 10): a.append(str(i)) b.append(0)c = []for i in range(1, 10): for j in range(1, 10): if j == i : ...

2019-06-21 17:17:52 387

原创 Python P1909 买铅笔

https://www.luogu.org/problemnew/show/P1909n = int(input())ans = 9999999999999for i in range(3): a = list( map(int, input().split()) ) k = ((n+(a[0]-1))//a[0])*a[1] ans = min(ans, k)...

2019-06-21 14:28:37 958

原创 Python P1089 津津的储蓄计划

https://www.luogu.org/problemnew/show/P1089k = -1sum, last = 0,0for i in range(12): a = int(input()) if(last + 300 < a) : k = i + 1 break last = last + 300 - a ...

2019-06-18 15:16:39 1616

原创 Python 输出整个字符画

https://www.luogu.org/problemnew/show/P1000print(""" ******** ************ ####....#. #..###.....##.... ###.......###### ...

2019-06-13 12:38:57 2560 1

原创 Python 保留小数位

https://www.luogu.org/problemnew/show/P14221.round()内置方法a = int(input())sum = 0if(a >= 401): sum += (a-400)*0.5663 a = 400if(a >= 151): sum += (a-150)*0.4663 a = 150sum += a*0.4...

2019-06-13 12:32:46 1772

原创 Interesting Numbers URAL - 2070 (规律)

Interesting NumbersURAL - 2070Nikolay and Asya investigate integers together in their spare time. Nikolay thinks an integer is interesting if it is a prime number. However, Asya thinks an intege...

2019-05-05 14:36:21 156

原创 D - Different Sums URAL - 2065 (规律)

D - Different SumsURAL - 2065Alex is a very serious mathematician and he likes to solve serious problems. For example, this problem.You are to construct an array ofnintegers in which the amo...

2019-05-05 14:35:31 137

原创 G - Game of Nuts URAL - 2068 (博弈)

G - Game of NutsURAL - 2068The war for Westeros is still in process, manpower and supplies are coming to an end and the winter is as near as never before. The game of thrones is unpredictable so...

2019-05-05 14:32:25 189

原创 H - Hard Rock URAL - 2069 (思维)

H - Hard RockURAL - 2069Ilya is a frontman of the most famous rock band on Earth. Band decided to make the most awesome music video ever for their new single. In that music video Ilya will go th...

2019-05-05 14:17:08 149

原创 Senior Pan HDU - 6166 (两个集合的最短路)

Senior PanHDU - 6166Senior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory problems everyday.The task is simple : ZKC will give Pan a directed graph e...

2019-05-03 20:30:48 164

原创 Layout POJ - 3169 (差分约束)

LayoutPOJ - 3169Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting fo...

2019-05-01 20:14:43 110

原创 Strings in the Pocket ZOJ - 4110 (manacher)

Strings in the PocketZOJ - 4110BaoBao has just found two stringsandin his left pocket, whereindicates the-th character in string, andindicates the-th character in string.As BaoBao i...

2019-04-30 15:04:04 146

原创 激光炸弹 HYSBZ - 1218 (二维前缀和)

激光炸弹HYSBZ - 1218一种新型的激光炸弹,可以摧毁一个边长为R的正方形内的所有的目标。现在地图上有n(N<=10000)个目标,用整数Xi,Yi(其值在[0,5000])表示目标在地图上的位置,每个目标都有一个价值。激光炸弹的投放是通过卫星定位的,但其有一个缺点,就是其爆破范围,即那个边长为R的正方形的边必须和x,y轴平行。若目标位于爆破正方形的边上,该目标将不会被摧毁...

2019-04-21 14:41:35 167

原创 Monitor HDU - 6514 (二维前缀和)

MonitorHDU - 6514Xiaoteng has a large area of land for growing crops, and the land can be seen as a rectangle ofn×mn×m.But recently Xiaoteng found that his crops were often stolen by a group ...

2019-04-21 13:19:22 497

原创 C - Marina and Vasya CodeForces - 584C (思维)

C - Marina and VasyaCodeForces - 584CMarina loves strings of the same length and Vasya loves when there is a third string, different from them in exactlytcharacters. Help Vasya find at least o...

2019-04-16 17:03:50 250

原创 Babelfish POJ - 2503 (hash)

BabelfishPOJ - 2503You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you unders...

2019-04-15 22:25:49 120

原创 K - Killer Names HDU - 6143 (dp)

K - Killer NamesHDU - 6143> Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empi...

2019-04-14 14:20:42 194

原创 D - Kefa and Dishes CodeForces - 580D (状压dp)

D - Kefa and DishesCodeForces - 580DWhen Kefa came to the restaurant and sat at a table, the waiter immediately brought him the menu. There werendishes. Kefa knows that he needs exactlymdish...

2019-04-14 13:29:51 245

原创 J - Gameia HDU - 6105 树上博弈

J - GameiaHDU - 6105Alice and Bob are playing a game called 'Gameia ? Gameia !'. The game goes like this :0. There is a tree with all node unpainted initial.1. Because Bob is the VIP player,...

2019-04-08 10:52:42 99

原创 Graveyard Design POJ - 2100 尺取

Graveyard DesignPOJ - 2100King George has recently decided that he would like to have a new design for the royal graveyard. The graveyard must consist of several sections, each of which must be ...

2019-04-06 17:39:22 146

原创 Sum of Consecutive Prime Numbers POJ - 2739 尺取法

Sum of Consecutive Prime NumbersPOJ - 2739Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer...

2019-04-06 17:00:35 164

原创 Bound Found POJ - 2566 尺取

Bound FoundPOJ - 2566Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: ...

2019-04-06 15:13:04 286

原创 Jessica's Reading Problem POJ - 3320 尺取法

Jessica's Reading ProblemPOJ - 3320Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wa...

2019-04-06 12:57:28 129

原创 Subsequence POJ - 3061 尺取法

SubsequencePOJ - 3061A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program t...

2019-04-06 12:54:00 108

原创 D-query SPOJ - DQUERY (莫队)

D-querySPOJ - DQUERYEnglish Vietnamese Given a sequence of n numbers a1, a2, ..., anand a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have...

2019-04-02 13:15:34 98

原创 K-th Number POJ - 2104 (主席树模板)

K-th NumberPOJ - 2104问题描述给定一个数组 a[1...n],数组元素各不相同,你的程序要对每次查询Q(i,j,k)作出回答,其中Q(i,j,k)的含义为在数组a[i...j]中第k大的数字.例如,给出数组a=(1, 5, 2, 6, 3, 7, 4).查询语句为Q(2, 5, 3),即从(5,2,6,3)中找出第3大的元素,将之排序得到(2, 3, 5, 6...

2019-04-02 13:06:49 116

原创 Dropping tests POJ - 2976 (01规划模板)

Dropping testsPOJ - 2976In a certain course, you takentests. If you getaiout ofbiquestions correct on testi, your cumulative average is defined to be.Given your test scores and a posi...

2019-04-01 13:47:23 81

原创 Dirt Ratio HDU - 6070 (01分数规划)

Dirt RatioHDU - 6070In ACM/ICPC contest, the ''Dirt Ratio'' of a team is calculated in the following way. First let's ignore all the problems the team didn't pass, assume the team passedXXp...

2019-04-01 13:43:24 226

转载 Hamming Distance HDU - 4712 (随机)

Hamming DistanceHDU - 4712(From wikipedia) For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. For calculating Hamming distance between two strings a an...

2019-03-30 22:23:03 134

原创 C - Kanade's sum HDU - 6058 (任意区间第K大求和 + 双向链表)

C - Kanade's sumHDU - 6058Give you an arrayA[1..n]A[1..n]of lengthnn.Letf(l,r,k)f(l,r,k)be the k-th largest element ofA[l..r]A[l..r].Specially ,f(l,r,k)=0f(l,r,k)=0ifr−l+1<kr−l+1&...

2019-03-30 13:53:34 147

空空如也

空空如也

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

TA关注的人

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