自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(380)
  • 收藏
  • 关注

原创 【codeforces1060C】【思维】【Maximum Subrectangle】

题目来源: http://codeforces.com/problemset/problem/1060/C题目描述现有两个长度分别为n,mn, mn,m的数组a,ba, ba,b,数组中的元素都为正数,令CCC为一个n×mn \times mn×m的矩阵,其中Ci,j=ai⋅bjC_{i, j} = a_i \cdot b_jCi,j​=ai​⋅bj​。现需要找CCC的一个子矩阵,子矩阵的元素...

2019-09-16 14:40:51 228

原创 【洛谷P2602】【数字计数】【来自小zhu的奥数计数方法】

题目描述给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。输入格式输入文件中仅包含一行两个整数a、b,含义如上所述。输出格式输出文件中包含一行10个整数,分别表示0-9在[a,b]中出现了多少次。输入样例1 99输出样例9 20 20 20 20 20 20 20 20 20分析:小zhu教给我的计数方法:例如213中有多少个1个位1...

2019-09-16 11:38:17 271 1

原创 【扩展中国剩余定理求解 && 逆元求解】POJ2891 Strange Way to Express Integers

Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KDescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The...

2019-06-17 14:16:20 294

原创 PAT(甲级)1017. Queueing at Bank (25)

Queueing at Bank (25)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line

2018-01-26 18:57:36 323

原创 PAT(甲级)1016. Phone Bills (25)

Phone Bills (25)A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call

2018-01-25 22:10:13 227

原创 PAT(甲级)1027. Colors in Mars (20)

Colors in Mars (20)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red

2018-01-22 19:14:58 191

原创 PAT(甲级)1015. Reversible Primes (20)

Reversible Primes (20)A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its re

2018-01-21 21:33:30 198

原创 PAT(甲级)1014. Waiting in Line (30)

Waiting in Line (30)Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait i

2018-01-21 20:24:50 391

原创 PAT(甲级)1013. Battle Over Cities (25)

Battle Over Cities (25)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know

2018-01-21 17:20:17 184

原创 HDU4496 D-City【并查集删边】

D-CityProblem Description Luxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exactly two D-points. Luxe

2018-01-21 16:30:36 356

原创 PAT(甲级)1012. The Best Rank (25)

The Best Rank (25)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Alge

2018-01-21 14:46:34 211

原创 PAT(甲级)1011. World Cup Betting (20)

World Cup Betting (20)With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup tr

2018-01-20 22:01:18 233

原创 PAT(甲级)1010. Radix (25)

Radix (25)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is “yes”, if 6 is a decimal number and 110 is a binary number.Now for any pair of posi

2018-01-20 20:58:37 188

原创 PAT(甲级)1009. Product of Polynomials (25)

Product of Polynomials (25)This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each lin

2018-01-19 21:08:11 182

原创 PAT(甲级)1008. Elevator (20)

Elevator (20)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It

2018-01-19 19:58:00 188

原创 PAT(甲级)1007. Maximum Subsequence Sum (25)

Maximum Subsequence Sum (25)Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the contin

2018-01-19 19:45:39 182

转载 最大连续子序列和

最大连续子序列和 转载于http://blog.csdn.net/sgbfblog/article/details/8032464 最大连续子序列和问题是个很老的面试题了,最佳的解法是O(N)复杂度,当然其中的一些小的地方还是有些值得注意的地方的。这里还是总结三种常见的解法,重点关注最后一种O(N)的解法即可。需要注意的是有些题目中的最大连续子序列和如果为负,则返回0;而本题目中的最大连续子序列

2018-01-19 11:42:21 292

原创 Linux下ftp搭建过程中所遇到的问题

1.首先就是yum install -y vsftpd 和 yum install -y lftp 下载安装不成功 简单的可以直接在vi /etc/sysconfig/network-scripts/ifcfg-eth0 里面 将 BOOTPROTO=”dhch” 然后Esc 之后:wq 保存退出 shutdown -r now 或者init 6重启虚拟机尝试一番 如果上面不行可以尝试更换

2018-01-19 10:29:36 444

原创 Linux下ftp服务器搭建

创建两个Linux虚拟机,完成初始配置,可以让两台Linux虚拟机能互相ping通 修改各自的 主机名,在/etc/sysconfig/network 文件中,完成如下设置 服务端主机名设置为 server 。客户端设置为 client 两台虚拟机已经ping通一、Vsftpd 简单用法 [root@localhost ~]# yum install -y vsftpd

2018-01-19 09:43:04 473

原创 Linux下实现虚拟机和主机的通信

1.实现虚拟机和主机的通信配置方式如下: 首先将VMnet1和VMnet8禁用 打开虚拟机 更改其网络适配器为 桥接模式 选择确定 然后进入虚拟机中,进行设置IP,与宿主在同一网段的其他IP 查看本机的IP地址和子网掩码 打开cmd命令窗口,输入ipconfig -all 如果是ping两台虚拟机 则输入ifconfig -a 进入虚拟机,打开一个命令窗口,输入se

2018-01-19 09:21:34 2036

原创 linux-CentOS-配置ip地址-配置putty远程连接工具

 配置动态IP 1、设置虚拟机网络连接方式为NAT: 2、以root身份进入linux,在命令行输入如下命令: vi /etc/sysconfig/network-scripts/ifcfg-eth0 打开ifcfg-eth0文件,使用方向键把把光标移动到ONBOOT这一行,按“i”键进入编辑模式,然后把这一行变成:”ONBOOT=yes” ,把BOOTPROTO行变成:BO

2018-01-18 21:22:58 2385 2

原创 Linux虚拟机-CentOS系统安装

1.创建新虚拟机 下一步直到完成即可。 2.安装CentOS6.3 1.打开新建的空白虚拟机,在设置中添加CentOS6.3光盘镜像 2.启动系统并进入BIOS中修改从光驱启动,点击向下箭头,选择【启动进入BIOS】 3.在BIOS中设置为光驱优先启动然后保存即可 4.选择默认第一项回车,开始安装。 5.选择中文,下一步 6.选择美国英语式键

2018-01-18 21:10:38 218

原创 PAT(甲级)1006. Sign In and Sign Out (25)

Sign In and Sign Out (25)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of sig

2018-01-18 20:32:12 198

原创 PAT(甲级)1005. Spell It Right (20)

Spell It Right (20) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contai

2018-01-18 11:10:32 158

原创 PAT(甲级)1004. Counting Leaves (30)

Counting Leaves (30) A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. InputEach input file contains one test case. Each case

2018-01-18 09:48:36 181

原创 PAT 甲级-1003. Emergency (25)

Emergency (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emergency rescue team leader of a city, you are given a special map of your country. The map shows severa

2018-01-17 10:25:21 193

原创 PAT甲级-1001. A+B Format (20)

A+B Format (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueCalculate a + b and output the sum in standard format – that is, the digits must be separated into groups of thre

2018-01-13 16:51:11 199

原创 PAT甲级-1002. A+B for Polynomials (25)

A+B for Polynomials (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThis time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains

2018-01-13 16:40:49 175

原创 模式匹配算法

串的模式匹配设有两个字符串S和T,设S 为主串,设T为子串。在主串S中查找与模式T相匹配的子串,如果匹配成功,确定相匹配的子串中的第一个字符在主串S中出现的位置。 一、 BF算法: 1. 指针i和j 分别指示主串S 和模式串T 中当前待比较的字符位置,i 和j初始值为1; 2. 取k来代替i从当前位置开始与j相匹配,此时的i用来记录它本来的值 而k是要随着j的变化而变化的 3. 遇

2017-09-14 22:05:04 1826

原创 Matlab 基本语句与函数运用

取整函数、取余函数、快捷键取整函数ceil(x) :不小于x的最小整数floor(x) :不超过x的最大整数fix(x) :朝0方向取整round(x) :四舍五入取整取余函数rem(x/y) :若x与y符号相同 其结果与mod函数一致,若符号不同,首先结果符号与x一致,其次结果的绝对值(个人总结)是除数   绝对值减去y绝对值的向下整数倍  例如 rem(-14,

2017-06-03 18:51:25 2065

原创 HDOj 5918 Sequence I【KMP】

Sequence ITime Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1226    Accepted Submission(s): 466Problem DescriptionMr. Frog has two s

2016-10-30 19:39:52 437

原创 HDOJ 5935 Car【模拟】

CarTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 256    Accepted Submission(s): 92Problem DescriptionRuins is driving a car to p

2016-10-30 19:27:53 459

原创 HDOJ 5927 Auxiliary Set【树】

Auxiliary SetTime Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 689    Accepted Submission(s): 209Problem DescriptionGiven a rooted t

2016-10-09 21:04:50 379

原创 HDOJ 5375 Gray code【dp 格雷码】

Gray codeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1216    Accepted Submission(s): 664Problem DescriptionThe reflected binary

2016-08-13 20:27:22 413

原创 HDOJ 1392 Surround the Trees【凸包周长 Graham扫描】

Surround the TreesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10208    Accepted Submission(s): 3941Problem DescriptionThere are

2016-08-10 21:24:03 411

原创 HDOJ 5316 Magician【线段树 单点更新 区间查询】

MagicianTime Limit: 18000/9000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3103    Accepted Submission(s): 845Problem DescriptionFantasy magicians usu

2016-07-26 17:35:37 420

原创 NYOJ 128 前缀式计算【栈】

前缀式计算时间限制:1000 ms  |  内存限制:65535 KB难度:3描述先说明一下什么是中缀式:如2+(3+4)*5这种我们最常见的式子就是中缀式。而把中缀式按运算顺序加上括号就是:(2+((3+4)*5))然后把运算符写到括号前面就是+(2 *( +(3 4) 5) )把括号去掉就是:+ 2 * + 3 4 5

2016-07-19 14:48:40 353

原创 NYOJ 467 中缀式变后缀式【栈】

中缀式变后缀式时间限制:1000 ms  |  内存限制:65535 KB难度:3描述人们的日常习惯是把算术表达式写成中缀式,但对于机器来说更“习惯于”后缀式,关于算术表达式的中缀式和后缀式的论述一般的数据结构书都有相关内容可供参看,这里不再赘述,现在你的任务是将中缀式变为后缀式。输入第一行输入一个整数n,共有n组测试数据(n每组测试数据只有一行,是

2016-07-18 21:39:42 347

原创 HDOJ 5720 Wool

WoolTime Limit: 8000/4000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 647    Accepted Submission(s): 185Problem DescriptionAt dawn, Venus sets a sec

2016-07-18 17:54:26 941

原创 NYOJ 35 表达式求值【栈】

表达式求值时间限制:3000 ms  |  内存限制:65535 KB难度:4描述ACM队的mdd想做一个计算器,但是,他要做的不仅仅是一计算一个A+B的计算器,他想实现随便输入一个表达式都能求出它的值的计算器,现在请你帮助他来实现这个计算器吧。比如输入:“1+2/4=”,程序就输出1.50(结果保留两位小数)输入第一行输入一个整数n,共有n组测试数

2016-07-18 15:22:03 364

空空如也

空空如也

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

TA关注的人

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