自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 mac os安装Windows系统失败后不能合并为一个分区

本人在学校电脑医院作志愿者,经常会遇到很多人拿着mac要求装Windows系统,这我就很无奈了呀,好好的macos不用非要用windows。那就装吧。。。。。其实在此之前我都很顺利的将几台mac装过windows,但人总有失败的。听我细细道来。(嫌我废话多可以直接跳过去看最后的 正文开始:如何将安装windows失败后的磁盘合并成一个。)一开始我打开bootcamp(启动转换助理),很顺溜...

2019-05-18 13:44:27 3131 1

原创 JAVA JDK安装及环境变量配置(cmd中输入javac无效解决办法)

打开java官网下载JDK。先点击接受许可“Accept License Agreement”,然后选择对应你的系统的版本。下载完成后打开jdk,无脑下一步,如果要更改安装路径,记住路径,之后配环境变量有用,即下图:后面弹出安装的另一个jre最好也安装在同一个文件夹下。然后,右键我的电脑——属性——高级系统设置——环境变量。在系统变量下:新建一个变量名:“JAVA...

2019-02-19 20:01:42 7929

原创 再学习KMP算法——next数组、nextval数组

对于看毛片算法(KMP)其实我觉得对简单匹配效率提升不多= =  只有在模式串和主串之间存在很多“部分匹配”的时候,才显得比BF算法(最直观的匹配算法,一个一个匹配)效率高。但是KMP对指示主串的指针不必回溯,整个匹配过程对主串只用扫描一次,这对处理从外设输入的庞大文件很有效,可以边读入边匹配,无需重头读,效率很高。 PS:不懂KMP算法基本过程的可以先读一下我的另一篇博客 KMP算法。...

2019-01-03 11:09:14 672

原创 ZCMU-2959:Amity Assessment

2959:Amity AssessmentTime Limit: 2 Sec  Memory Limit: 256 MBSubmit: 55  Solved: 19[Submit][Status][Web Board]DescriptionBessie the cow and her best friend Elsie each received a sliding puzzle ...

2018-09-18 18:32:24 270 1

原创 ZCMU-1165: 忠哥的dp(I)

1165: 忠哥的dp(I)Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 146  Solved: 46[Submit][Status][Web Board]Description  有n个矩形,每个矩形可以用两个整数a,b描述,表示他的长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c&&...

2018-08-13 16:41:35 235

原创 ZCMU-1185: 走迷宫(DFS)

1185: 走迷宫Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 356  Solved: 141[Submit][Status][Web Board]Description给一张个迷宫,问能否从起点走到终点,只能往上下左右走,不能斜着走Input多组测试数据,每组第一行两个正整数,分别为n和m表示n这个迷宫有n行m列(0&...

2018-08-13 15:35:18 459

原创 ZCMU-1184 帮我求算一下斐波那契数吧(矩阵快速幂+应用)

1184: 帮我求算一下斐波那契数吧Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 261  Solved: 57[Submit][Status][Web Board]DescriptionAYY小朋友对斐波那契数非常感兴趣,他知道f[1]=1,f[2]=1,并且从第三个斐波那契数开始f[n]=f[n-2]+f[n-1](n>=3...

2018-08-13 13:17:07 337

原创 整数快速幂

问题引入:我们经常要计算一个整数的幂,如,现在要求计算a^8是多少。若按寻常想法肯定是循环7次得a*a*a*a*a*a*a*a。但这样太慢了,所以我们可以这样想(a*a)*(a*a)*(a*a)*(a*a),这样只用算a*a一次,和3次(a*a)*(a*a),一共四次。这样比7次就减少3次运算了,当多次计算幂时,算法效率就比较高了。如何实现呢?这时候可以用二进制来计算:例如a^19...

2018-08-13 13:04:39 207

原创 L - Left Mouse Button (DFS)

Mine sweeper is a very popular small game in Windows operating system. The object of the game is to find mines, and mark them out. You mark them by clicking your right mouse button. Then you will plac...

2018-08-12 10:54:50 316

原创 F - Queen Collision (打表)

【解析】一开始以为八皇后,结果。。。题意:给出棋盘n*n和q对变化,每对坐标为i = 0,1……k-1.问会造成多少次碰撞(横竖、对角线都算碰撞)#include <bits/stdc++.h>using namespace std;int r[30010], c[30000], zhu[60010], fu[60010];int main(){ i...

2018-08-10 19:40:57 203

原创 J - Image Compression (递归画图)

  【解析】题意:给你介绍了一下压缩技术的原理,先说了无损压缩的原理,然后又说可以用于有损压缩,即对相似度高于T%的部分都可以用同一个值表示,如:对压缩率为70的一块区域1101那么我们可以全部变为1(1的占有率为75%>70% ,0的占有率为25%<70%)然后不断的细分整张图每次均分为4块,再执行上述操作。 很明显是递归了。题...

2018-08-10 19:33:06 189

原创 D - Mad Scientist (打表模拟)

A mad scientist performed a series of experiments, each having n phases. During each phase, a measurement was taken, resulting in a positive integer of magnitude at most k. The scientist knew that an ...

2018-08-10 19:23:06 199

原创 E - Voting(模拟)

A committee clerk is good at recording votes, but not so good at counting and figuring the outcome correctly. As a roll call vote proceeds, the clerk records votes as a sequence of letters, with one l...

2018-08-10 19:14:55 226

原创 G - Mirror, Mirror on the Wall (分支判断+if)

For most fonts, the lowercase letters b and d are mirror images of each other, as are the letters p and q. Furthermore, letters i, o, v, w, and x are naturally mirror images of themselves. Although ot...

2018-08-10 19:08:08 220

原创 G - Game Rank (模拟)

The gaming company Sandstorm is developing an online two player game. You have been asked to implement the ranking system. All players have a rank determining their playing strength which gets updated...

2018-08-09 18:11:58 239

原创 D - Daydreaming Stockbroker(模拟)

Gina Reed, the famous stockbroker, is having a slow day at work, and between rounds of solitaire she is daydreaming. Foretelling the future is hard, but imagine if you could just go back in time and u...

2018-08-09 18:01:54 196

原创 J - Jumbled Compass (旋转问题)

Jonas is developing the JUxtaPhone and is tasked with animating the compass needle. The API is sim- ple: the compass needle is currently in some direc- tion (between 0 and 359 degrees, with north bein...

2018-08-09 17:52:16 228

原创 线段树——区间和

#include <bits/stdc++.h>using namespace std;inline int read(){ char ch; while ((ch = getchar()) < '0'&&ch > '9'); int res = ch - 48; while ((ch = getchar()) >= '0'&&...

2018-08-09 10:41:55 1176

原创 线段树——求区间最大最小值

//问最小值//Q a b 询问(a,b)中最小值//C a b 将a点值改为b#include <bits/stdc++.h>using namespace std;#define maxn 200005int min(int a, int b){ return a>b ? b : a;}int tree[4 * maxn];void pushup(...

2018-08-09 10:35:31 7965 1

原创 RMQ问题与ST算法

对于问题(RMQ,Random Maximum Query):给你一串固定、不修改的数字,询问多次某个区间内的最大值或者最小值。用朴素的想法,依次遍历得到答案,时间复杂度为O(n),但是对于多次询问,如1E6次询问,这样的算法就不是最优的了。所以出现了ST算法。ST算法的原理是动态规划,通过O(logn)的预处理dp数组,得到O(1)的询问。1.预处理假设dp[i,j]表示从a[i...

2018-08-08 15:50:15 351

原创 ZCMU一口气A完首页C语言练习题

1061: 求两个数的和与差作为第一题,附完整代码与超详细解析!#include <stdio.h>//头文件,基本IO函数声明存放处,如果没有的话,满屏error吧 int main(void)//主函数,作为程序运行的入口//该程序开始运行时,一般都是从此依次执行,函数调用时才发生跳转 //最前面的int表示函数返回值类型 { int a,b,sum,diff;...

2018-08-07 18:58:31 2098

原创 AC自动机

AC自动机的算法来自贝尔实验室,它是一种解决多模式串匹配问题的算法。如:给出n个单词T,再给出一段包含m个字符串的文章,问有多少个单词在文章里出现?它结合了KMP算法和Trie字典树算法。所以学习AC自动机前要先学习KMP和Trie。 提供一些学习资料:https://www.bilibili.com/video/av2975983/?p=37【KMP算法学习视频】Trid字典...

2018-08-07 18:07:01 133

原创 初识标准库bitset类型

对于要处理二进制位的有序集,每个位可能包含0或1值,我们可以用C++标准库中的bitset类型。该类型的声明与vector等基本相同,不同的是vector定义时是存放的数据类型,而bitset存放的是大小,例如:bitset<32> bitvec;//32 bits,all zero对其初始化有以下几种方法:1.bitset<n> b;   //b有n位...

2018-08-06 13:55:15 126

原创 红黑树(B数)学习

B数的存在,是为了解决内存和外存(磁盘)因读写速度不同导致的效率低下的问题,所以B数的建立能有效降低重复读写硬盘的问题。学习前,要先了解2-3树、2-3-4树的概念以及建立、删除的操作方法。https://blog.csdn.net/sun_tttt/article/details/65445754#include "stdio.h" #include "stdlib.h" ...

2018-08-05 14:39:39 171

原创 L - Problem L. Visual Cube (模拟打印图)

Little Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a 3D geometry problem, he will struggle to draw a picture. Now he meets a...

2018-08-03 18:30:02 209

原创 F - Problem F. Grab The Tree (博弈)

Little Q and Little T are playing a game on a tree. There are nn vertices on the tree, labeled by 1,2,...,n1,2,...,n, connected by n−1n−1 bidirectional edges. The ii-th vertex has the value of wiwi. ...

2018-08-03 18:27:12 336

原创 D - Problem D. Euler Function (欧拉函数找规律)

In number theory, Euler's totient function φ(n)φ(n) counts the positive integers up to a given integer nn that are relatively prime to nn. It can be defined more formally as the number of integers kk ...

2018-08-03 18:18:50 641

原创 数星星(树状数组)

 Description天文学家经常观察星象图。星象图中用平面上的点来表示一颗星星,每一颗星星都有一个笛卡尔坐标。设定星星的等级为其左下角星星的总数。天文学家们想知道星星等级的分布情况                                             **(5)                       **(4)*(1)                ...

2018-08-02 18:53:03 524

原创 Photo List(poj3630,Trid字典树的运用)

Phone ListTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 33616   Accepted: 9698 DescriptionGiven a list of phone numbers, determine if it is consistent in the sense t...

2018-08-02 14:53:59 198

原创 Trie字典树

#include <bits/stdc++.h>using namespace std;const int N = 1000;//N个串const int Z = 27;//字符集大小(此处以26个小写英文字母为例)int ch[N][Z], ans;//ch表示字典树,ans表示总节点数bool bo[N];//第几个节点是否是实际字符串集合中的元素bool inse...

2018-08-02 14:09:28 124

原创 前缀和

所谓前缀和,可以简单归纳成一条公式,即ans[ i ] = ans[ i - 1 ] + a[ i ];如何理解,看例题: Description已知两个正整数a和b,求在a与b之间(包含a和b)的所有整数的十进制表示中1出现的次数。Input多组数据(不超过100000组),每组数据2个整数a,b.(1≤a,b≤1000000).Output每组数据的答案占一行。...

2018-08-02 14:03:38 600

原创 杭电多校训练赛:D - Distinct Values(向左排序+set维护)

Chiaki has an array of nn positive integers. You are told some facts about the array: for every two elements aiai and ajaj in the subarray al..ral..r (l≤i<j≤rl≤i<j≤r), ai≠ajai≠aj holds. Chiaki ...

2018-08-01 19:19:52 173

原创 多校训练赛:K - Time Zone (扩大再缩小)

Chiaki often participates in international competitive programming contests. The time zone becomes a big problem. Given a time in Beijing time (UTC +8), Chiaki would like to know the time in another ...

2018-08-01 19:15:53 189

原创 多校训练赛1:C. Triangle Partition(按关键词排序?不知道)

Chiaki has 3n3n points p1,p2,…,p3n It is guaranteed that no three points are collinear. Chiaki would like to construct n disjoint triangles where each vertex comes from the 3n points. InputThere ...

2018-08-01 19:10:51 153

原创 ZCMU-1040:二哥的困惑Ⅲ(贪心)

1040: 二哥的困惑 ⅢTime Limit: 1 Sec  Memory Limit: 128 MBSubmit: 216  Solved: 84[Submit][Status][Web Board]Description Suppose there are M people, including you, playing a special card game. At th...

2018-08-01 10:37:57 193

原创 PAT:Stack (30)(树状数组+二分查找)

Stack 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) and ...

2018-07-31 20:49:38 296

原创 ZCMU-2165:黄金矿工(变形01背包)

2165: 黄金矿工Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 58  Solved: 28[Submit][Status][Web Board]DescriptionInput3 10 1 1 1 1 2 2 2 2 1 3 15 9Output3 Sample InputSample Ou...

2018-07-31 18:47:56 261

原创 ZCMU-2014: 一生之敌(数学+枚举)

2014: 一生之敌Time Limit:1 SecMemory Limit:128 MBSubmit:723Solved:116[Submit][Status][Web Board]DescriptionInput第一行输入一个整数T,表示数据组数。每组数据输入一个整数n。1 <= T <= 1000000 <=...

2018-07-31 18:24:53 458 1

原创 ZCMU-2164:去注释

2164: 去注释Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 104  Solved: 44[Submit][Status][Web Board]Description给你一段C++代码,将其中的注释去除后输出剩余的代码。注释共有两种形式:1. 行注视:以//开头,一直作用到行尾为止。例子:int n;//n表示数据规模i...

2018-07-31 18:11:13 128

原创 ZCMU-1127: 第三章:再见,林静!

1127: 第三章:再见,林静!Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 87  Solved: 21[Submit][Status][Web Board]Description郑薇的专业是土木工程,理工科的女生原本就是珍稀动物,而且大多数都长得比较抽象。想她郑微虽然不是什么绝代美女,跟她漂亮的妈妈相比也有一定差距,但她有一张讨...

2018-07-30 20:59:59 259

空空如也

空空如也

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

TA关注的人

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