自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【面经】华为OD软件测试

本人山东双非一本,二战失利后参加工作,面试时参考了网上很多面经,前人栽树后人乘凉,写一下自己的面试经历。2.16 机试总分400,两道简单题各100分,一道中等题200分,每题按照通过样例百分比计分,150分通过。建议尽可能多拿分,可能会影响后续定级。对于ACM选手来说会比较简单,小白建议去刷一下力扣简单中等题目,拿到150分难度不大。我机考时遇到了两道字符串处理和一道数位DP。2.17 性格测试注意前后一致,围绕积极向上团结主题即可,会有重复题目,特别注意前后回答一致。2.21 技术一

2022-03-01 09:06:20 10279 11

原创 【无标题】

next()方法以空格与回车为结束符nextLine()方法只以回车为结束符charAt(int)方法返回下标处的单个字符toUpperCase() toLowerCase()方法把string全部转换为大小写hasNext()函数用于多组输入

2022-02-20 18:39:09 320

原创 被3整除的子序列(线性dp)

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述给你一个长度为50的数字串,问你有多少个子序列构成的数字可以被3整除答案对1e9+7取模输入描述:输入一个字符串,由数字构成,长度小于等于50输出描述:输出一个整数示例1输入复制132输出复制3示...

2019-05-28 21:08:11 2281 2

原创 牛牛与数组(简单dp)

链接:https://ac.nowcoder.com/acm/problem/21738来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述牛牛喜欢这样的数组:1:长度为n2:每一个数都在1到k之间3:对于任意连续的两个数A,B,A<=B 与(A % B !=...

2019-05-27 19:48:54 846

原创 19年山东省赛 Happy Equation (数论)

Little Sub has just received an equation, which is shown below, as his birthday gift.Given the value of , please help Little Sub count the number of () which satisfies the equation.InputThere ar...

2019-05-13 21:44:58 623

原创 Find the Marble(简单dp)

Alice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts, Alice puts the pots in one line and puts the marble in one of the pots. After th...

2019-05-09 20:32:56 188

原创 Java大数整理

一.BigInteger1. int s = 99; BigInteger a = BigInteger.valueOf(s); 则a = 99 BigInteger[] dd = new BigInteger[500];开辟大数数组2. String a; BigInteger b = new BigIn...

2019-05-07 21:37:21 225

原创 Sorting It All Out (拓扑排序)

An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D im...

2019-03-14 21:09:28 285

原创 Boring count (尺取法)

You are given a string S consisting of lowercase letters, and your task is counting the number of substring that the number of each lowercase letter in the substring is no more than K.InputIn the ...

2019-03-10 19:06:53 270

原创 山东省第二届ACM大学生程序设计竞赛 I - Sequence

      题目链接SequenceTime Limit: 1000 ms Memory Limit: 65536 KiBProblem DescriptionGiven an integer number sequence A of length N (1&lt;=N&lt;=1000), we define f(i,j)=(A[i]+A[i+1]+...+A[j])^2 (i&...

2019-02-26 19:31:59 267

原创 An Olympian Math Problem

Alice, a student of grade 666, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about the problem. Thus he wants you to help him...

2018-09-05 14:36:47 378 1

原创 HDU 6153 A Secret (KMP)

http://acm.hdu.edu.cn/showproblem.php?pid=6153题目: Problem DescriptionToday is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in th...

2018-08-16 18:59:20 206

原创 CF 1016C Vasya And The Mushrooms (DP)

codeforces 1016c题目:Vasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of which can be divided into n consecutive cells. For each cel...

2018-08-16 09:23:02 396

原创 HDU 5835 Danganronpa (贪心)

hdu 5835 题目:Problem DescriptionChisa Yukizome works as a teacher in the school. She prepares many gifts, which consist of n kinds with a[i] quantities of each kind, for her students and wants to...

2018-08-14 16:41:51 241

原创 HDU 5832 A water problem (高精度取模)

hdu 5832题目:Problem DescriptionTwo planets named Haha and Xixi in the universe and they were created with the universe beginning.There is 73 days in Xixi a year and 137 days in Haha a year.Now ...

2018-08-14 14:38:38 181

原创 HDU 1260 Tickets (线性DP)

hdu 1260题目:Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back h...

2018-08-13 19:06:52 193

原创 HDU 6373 Pinball (物理)

hdu 6373题目:There is a slope on the 2D plane. The lowest point of the slope is at the origin. There is a small ball falling down above the slope. Your task is to find how many times the ball has be...

2018-08-12 17:25:13 305

原创 HDU 6362 oval-and-rectangle (多校水题)

hdu 6362题目:Problem DescriptionPatrick Star find an oval.The half of longer axes is on the x-axis with length a.The half of shorter axes is on the y-axis with length b.Patrick Star plan to cho...

2018-08-12 16:52:08 338

原创 HDU 6354 Everything Has Changed (多校水题)

hdu 6354题目:Problem DescriptionEdward is a worker for Aluminum Cyclic Machinery. His work is operating mechanical arms to cut out designed models. Here is a brief introduction of his work.Assume...

2018-08-12 13:34:34 521

原创 HDU 2476 String painter (区间DP)

hdu 2476题目:Problem DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painte...

2018-08-10 14:52:52 179

原创 POJ 3061 Subsequence (尺取法)

poj 3061题目:DescriptionA sequence of N positive integers (10 &lt; N &lt; 100 000), each of them less than or equal 10000, and a positive integer S (S &lt; 100 000 000) are given. Write a program ...

2018-08-09 09:26:32 188

原创 HDU 6343 Problem L. Graph Theory Homework (思维)

hdu 6343There is a complete graph containing n vertices, the weight of the i-th vertex is wi.The length of edge between vertex i and j (i≠j) is .Calculate the length of the shortest path from 1 to...

2018-08-02 17:07:19 246 2

原创 Halloween Costumes (区间DP)

VJ链接题目:Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume p...

2018-08-02 10:52:12 470

原创 HDU 1024 Max Sum Plus Plus (最大M子串和优化)

hdu 1024题目:Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36636    Accepted Submission(s): 13050 Problem Description...

2018-08-01 20:30:39 210

原创 HDU 1029 Ignatius and the Princess IV (简单DP)

hdu 1029题目:Ignatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 42940    Accepted Submission(s): 18774 Problem ...

2018-08-01 13:16:12 301

原创 POJ 1160 Post Office(区间DP)

poj 1160Post OfficeTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21315   Accepted: 11522 DescriptionThere is a straight highway with villages alongside the highway...

2018-08-01 11:16:04 458 5

原创 POJ 2955 Brackets (区间DP)

题目链接:POJ 2955 We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s...

2018-07-31 16:18:39 187

原创 区间DP入门及平行四边形优化

区间DP, 指的就是对区间的DP, 主要的思想是依旧是最优子结构和无后效性的确保, 一般思路就是先对小区间进行操作得到最优解, 然后通过小区间的最优解来得到大区间的最优解。利用dp[i][j]数组来表示从 i 到 j 区间合并的最优值。这里笔者给出基本的区间DP模板帮助理解://n是区间长度,dp[i][j]存从i 到 j 区间合并的最优值//w[i][j]表示从i 到 j的花费...

2018-07-31 11:07:07 3074 1

原创 LIS(最长上升子序列)的 n ^ 2, nlogn解法以及路径标记

最长上升子序列(Longest Increasing Subsequence,LIS)是一个数列中最长的(非)严格上升的子序列, LIS的求解是DP思想的一个经典体现, 这里通过例题来介绍两种复杂度不同的解法和一个标记路径的问题。一. n ^ 2 解法(双层循环递推关系式)例:hdu 1160链接戳我题意是一只老鼠有体重跟速度两种属性, 每一行会都会输入一只老鼠的体重和速度,同时每...

2018-07-30 08:59:55 2617 3

原创 HDU 6299 Balanced Sequence (模拟贪心)

题目:Chiaki has n strings s1,s2,…,sn consisting of '(' and ')'. A string of this type is said to be balanced:+ if it is the empty string+ if A and B are balanced, AB is balanced,+ if A is balanced,...

2018-07-29 17:15:02 260

原创 数位DP入门 —— hdu2089 不要62

数位DP是一种用来计数的DP, 如果给你一道题, 让你去统计区间[l, r]之间满足某种条件的数字个数, 在没接触数位之前很容易想到的就是暴力判断。但当数据范围较大时这种方法就不可行了, 这时候我们就可能要用的差分的思想确定一个递推关系, 来更方便更高效的求解, 这就是数位DP。这种理论的东西可能写出来帮助不大, 数位DP的思想是通过自己对问题的思考逐渐建立的, 下面是我选的一个例题来帮助初步理解...

2018-07-27 14:21:27 338 2

原创 剪花布条——kmp

一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Outpu...

2018-01-21 20:13:45 273

原创 HDU Play on Words(并查集——欧拉通路)

Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impor

2017-11-30 09:29:10 260

原创 HDU 畅通工程(优美的数据结构——并查集)

某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一

2017-11-30 09:23:08 400

原创 SDNU OJ 1025 马踏飞燕

该题是一道使用BFS(广度优先搜索)的经典题目(当然如果你不怕麻烦,DFS也是可以的), 思路很简单,用queue存下各个情况每次都判断是否踏到燕子,并且记得记录深度。Description无聊的陶陶准备编写一款游戏,名字就叫做“马踏飞燕”,在这款游戏中有个一个100*100的坐标,把马放在任意一个坐标点,再把燕子放在任意一个坐标点,并且燕子不会移动,马只能按照象棋规则走“日”。若4步之内...

2017-11-24 22:40:29 728

原创 VJ pet(DFS)

这个题在用DFS递归的时候还要记录下当前的位置。#include#include#include#include#include#includeusing namespace std;vectorint> GG[100005];int y, g = 0,jieguo = 0.;int DFS(int x){ for(auto &v: GG[x]){

2017-11-22 12:03:47 326

原创 快速幂

庞大的幂运算会耗费极多的时间,但我们可以通过一种特殊的运算方式来降低时间复杂度。假设我们要求a的b次方,b可以表示为二进制数的形式,进而又可以写成2的几次方相加的形式,那么原本的a的b次方又可以写成a的2的k次方乘a的2的其他次方的形式(数学上的幂运算)。举个例子: a^11=a^(2^0+2^1+2^3)又可以写作 a^11=a^(2^0)*a^(2^1)*a^(2^3)

2017-11-10 10:07:53 189

原创 大数加法

在处理某些问题的时候有时会遇到及其庞大的数字,数字型的变量可能不能完全容纳,那么此时我们可以用字符串来实现庞大数字的运算。将字符串存入数组中,a[0](a[1]也可以)是最低位,从最低位开始加,将每位相加的结果存入另一个数组中,要考虑的是进位的问题,可以依次处理每一位向前进位,最后再输出即可。以下代码为边加边进位的方式,也可以选择先加完,最后进位。 #include&lt;std...

2017-11-10 10:02:19 200

空空如也

空空如也

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

TA关注的人

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