自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 vue+node+mysql 实现数据使用

vue+node+mysql 实现数据使用安装mysqlnpm i mysqlvue项目根目录下创建db文件夹,含sql.jsvar mysql = require('mysql')var con = mysql.createConnection({ host: 'localhost', // 或 127.0.0.1 user: '管理者名称', password: '数据库密码', database: '数据库名称'})module.exports = con;//

2022-02-21 22:25:58 1053 1

原创 HDU 1002 A + B Problem II

Problem DescriptionGiven a sequence a[1],a[2],a[3]…a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 1...

2019-11-09 10:43:32 112

原创 ZOJ 1115 Digital Roots (C)

题目BackgroundThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value...

2019-08-31 10:06:30 110

原创 CodeForces 96A Football (C)

题目Petya loves football very much. One day, as he was watching a football match, he was writing the players’ current positions on a piece of paper. To simplify the situation he depicted it as a string...

2019-08-31 09:45:28 185

原创 CodeForces 158A Next Round (C)

题目“在比赛中,选手的得分与第k个选手的分数相等或大于就可以晋级下一轮,同时分数大于0才可晋级。”摘自竞赛规则的摘录。总共有n个参与者参加了比赛(n>=k),你已经知道他们的分数了。计算有多少参与者将晋级到下一轮。Input输入的第一行包含两个整数n和k(a <= k <= n <= 50),由一个空格隔开。第二行包含n空间分隔的整数a1,a2,…a(0 <= ...

2019-08-31 09:42:17 115

原创 CodeForces 732A Buy a Shovel (C)

题目Polycarp urgently needs a shovel! He comes to the shop and chooses an appropriate one. The shovel that Policarp chooses is sold for k burles. Assume that there is an unlimited number of such shovel...

2019-08-31 09:40:42 101

原创 CodeForces 189A Cut Ribbon (C)

题目Polycarpus has a ribbon, its length is n. He wants to cut the ribbon in a way that fulfils the following two conditions:After the cutting each ribbon piece should have length a, b or c.After the ...

2019-08-31 09:34:27 94

原创 CodeForces 920A Water The Garden (C)

题目It is winter now, and Max decided it’s about time he watered the garden.The garden can be represented as n consecutive garden beds, numbered from 1 to n. k beds contain water taps (i-th tap is loc...

2019-08-31 08:53:29 113

原创 CodeForces 996A Hit the Lottery (C)

题目Allen has a LOT of money. He has n dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are 1, 5, 1...

2019-08-31 08:31:29 355

原创 CodeForces 282A Bit++ (C)

题目X++是一种非常简单的编程语言,它只有两种操作++操作:X的值加1– 操作: X的值减1X++ 语言是一种序列语言,仅由若干个单独的语句构成, 语句只含有一种操作和一个变量X. 语句不含空格,只有 “+”, “-”, "X"这三种字符.语句之间仅用换行符隔开,不含其他字符现在给你一段X++语言源代码,X的初始值为0,求出程序运行结束后,X的值为多少。Input第一行一个正整数 ...

2019-08-31 08:17:48 90

原创 给你2个分数,求他们的和,并要求和为最简形式。

题目给你2个分数,求他们的和,并要求和为最简形式。Input输入首先包含一个正整数T(T<=1000),表示有T组测试数据,然后是T行数据,每行包含四个正整数a,b,c,d(0<a,b,c,d<1000),表示两个分数a/b 和 c/d。Output对于每组测试数据,输出两个整数e和f,表示a/b + c/d的最简化结果是e/f,每组输出占一行。Sample Inpu...

2019-08-31 08:09:29 4043 1

原创 Coin Change

题目Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 11 cents, then we ca...

2019-08-13 20:46:21 273

原创 HDU 2602 Bone Collector

题目Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave …The bone collect...

2019-08-13 20:01:53 66

原创 HDU 2041 超级楼梯

题目有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法?Input输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1<=M<=40),表示楼梯的级数。Output对于每个测试实例,请输出不同走法的数量Sample Input223Sample Output12注意:刚开始在第一级台阶上...

2019-08-13 19:51:34 109

原创 HDU 2018 母牛的故事

题目有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?Input输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0<n<55),n的含义如题目中描述。n=0表示输入数据的结束,不做处理。Output对于每个测试实例,输出在第n年的时候母牛的数量。每个输出占一行。Sample ...

2019-08-13 19:39:23 95

原创 hdu 2084 数塔

题目在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高度,接下来用N行数字表示数塔...

2019-08-13 19:29:45 84

原创 CodeForces - 1156C

题目有n个数字,x1,x2,xn;两个数字能够匹配要满足:1:i,j没有被匹配过 //注意这里意思是i和j都没有被使用过2:|xi-xj|>=z问最多有多少对能够匹配Input第一行输入两个正整数n和z。2<=n<2e5,1<=z<=1e9第二行输入n个正整数 x1到xn 1<=xi<=1e9Output输出一个正整数,最多有...

2019-08-07 14:28:46 215

原创 HDU - 2502

题目当寒月还在读大一的时候,他在一本武林秘籍中(据后来考证,估计是计算机基础,狂汗-ing),发现了神奇的二进制数。如果一个正整数m表示成二进制,它的位数为n(不包含前导0),寒月称它为一个n二进制数。所有的n二进制数中,1的总个数被称为n对应的月之数。例如,3二进制数总共有4个,分别是4(100)、5(101)、6(110)、7(111),他们中1的个数一共是1+2+2+3=8,所以3对应...

2019-08-06 11:03:55 155

原创 POJ - 2940

题目As you may know from the comic “Asterix and the Chieftain’s Shield”, Gergovia consists of one street, and every inhabitant of the city is a wine salesman. You wonder how this economy works? Simple ...

2019-08-05 10:48:55 78

原创 POJ - 2739

题目据说冰牙白虎在反抗暗黑达的时候由于用力过猛,导致法力尽失。但想到当小渡找到他的时候,他居然变成了一个连数都数不清的傻喵。白虎虽然变成了喵,但是他却依然要给小渡设立考验。由于白虎大人数不清数了,他想要算数学题就十分困难,现在他只知道一些整数可以用一个或多个连续的素数和表示。现在他给出你一个正整数n,你要算出这个整数可以有多少种这样的表示方法。比如:53 有两种表示方法 5 + 7 + 11...

2019-08-05 09:06:49 209

原创 POJ - 3187

题目FJ 和 他的奶牛们在玩一个心理游戏。他们以某种方式写下1至N的数字(1<=N<=10)。 然后把相邻的数相加的到新的一行数。重复这一操作直至只剩一个数字。比如下面是N=4时的一种例子3 1 2 4 4 3 6 7 9 16在FJ回来之前,奶牛们开始了一个更难的游戏:他们尝试根据最后结果找到开始的序列。这已超过了FJ的思考...

2019-08-05 08:58:26 168

原创 POJ - 1833

题目有一天Yu’an拿到了Glory的手机,发现了一些奇怪的通话记录。已知Glory的每一条通话记录是某个n的全排列,且通话记录按全排列的字典序顺序排列。已知第一条通话记录的全排列,及可疑通话记录是第k条,请问可疑的通话记录是什么? 比如:n = 3,k=2 给出排列2 3 1,则它的下1个排列为3 1 2,下2个排列为3 2 1,因此答案为3 2 1。 如果遇到最后一个排列,则下1排列为第1个...

2019-08-05 08:49:12 93

原创 POJ - 1804

题目考虑具有n个数的排列a[1],a[2],……,a[n],如果其中存在j,k,满足j < k 且a[j] > a[k] , 那么就称(a[j] , a[k] )是这个排列的一个逆序。一个排列含有逆序的个数称为这个排列的逆序数。例如排列 263451 含有8个逆序(2,1),(6,3),(6,4),(6,5),(6,1),(3,1),(4,1),(5,1),因此该排列的逆序数就是8...

2019-08-05 08:41:55 63

原创 POJ - 3250 Bad Hair Day

题目Some of Farmer John’s N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top ...

2019-08-01 20:20:24 79

原创 POJ3090 Visible Lattice Points

题目输入n,问从坐标(0,0)点能看到多少点,点的坐标范围是0<=(x,y)<=n只有一个点没有被另一个点挡住才能看到。如上图,n=5的时候,能看到21个点Input第一行输入t,表示样例个数。1<=t<=1000 接下来t行,每行输入一个正整数n 。 1<=n<=1000Output输出n行三列。 第一列从1到n表示第i个样例,第二列输出n,第...

2019-08-01 20:19:14 83

原创 POJ 3494 Largest Submatrix of All 1’s

题目Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements.InputThe input contains multiple test cases. Each ...

2019-08-01 19:35:23 90

原创 hdu1506 Largest Rectangle in a Histogram

题目A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left sho...

2019-07-31 19:45:16 58

原创 HDU1009 FatMouse' Trade

题目FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contains J[i] pounds of ...

2019-07-31 16:35:14 60

原创 POJ 3320 Jessica's Reading Problem

题目Jessica’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 wants to pass it, she has to master all ideas i...

2019-07-31 14:53:11 80

原创 POJ 2376 Cleaning Shifts

题目Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the da...

2019-07-29 21:56:28 56

原创 HDU2124 Repair the Wall

题目Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon.When the typhoon came, everything is terrible....

2019-07-29 21:18:18 97

原创 HRBUST - 1530

题目My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each ...

2019-07-29 21:11:15 60

原创 POJ2456 Aggressive cows

题目Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).His C (2 <= C ...

2019-07-29 20:58:30 199

原创 hdu 2716 Message Decowding

题目The cows are thrilled because they’ve just learned about encrypting messages. They think they will be able to use secret messages to plot meetings with cows on other farms.Cows are not known for t...

2019-07-29 20:02:26 86

原创 AcWING 90. 64位整数乘法

题目求 a乘 b对 p取模的值。输入格式第一行输入整数a,第二行输入整数b,第三行输入整数p。输出格式输出一个整数,表示a*b mod p的值。数据范围1≤a,b,p≤10^18输入样例:345输出样例:2这个题也需要快速幂a乘b就是b个a相加,把b转换成二进制的形式再进行解题(代码中不用呈现,计算机本身就是二进制存储)举几个例子 (a统统等于3)b=4 二进制...

2019-07-29 16:57:40 112

原创 HDU 2709 Sumsets

题目Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers th...

2019-07-29 15:40:55 69

原创 HDU 2524

题目给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格.Input第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n < 100 , m < 100).Output每行输出网格中有多少个矩形.Sample Input21 22 4Sample Output330能想出思路啥都好说第...

2019-07-29 15:15:26 104

原创 hdu 2710 素数打表

题目jc学长最近在做素数题,kd学弟就随便写了多组数,每组有n个数,让找出这些数里面哪一个数有最高的素数因子(所有因子里面是素数并且最大的数,这里的因子包括1和它本身)。素数是没有除数的数,除了1和它本身。数字7是素数,而数字6可以被2和3整除不是素数。为了简单学弟认为1也是素数(实际上1并不是素数你可以假装不知道)给定n个整数(1<n<=5000),整数d在1-20000范围内,...

2019-07-29 14:48:43 78

原创 hdu 2563

题目在一无限大的二维平面中,我们做如下假设:1、 每次只能移动一格;2、 不能向后走(假设你的目的地是“向上”,那么你可以向左走,可以向右走,也可以向上走,但是不可以向下走);3、 走过的格子立即塌陷无法再走第二次;求走n步不同的方案数(2种走法只要有一步不一样,即被认为是不同的方案)。Input首先给出一个正整数C,表示有C组测试数据接下来的C行,每行包含一个整数n (n&...

2019-07-28 22:34:29 66

原创 hdu 2535

题目美国大选是按各州的投票结果来确定最终的结果的,如果得到超过一半的州的支持就可以当选,而每个州的投票结果又是由该州选民投票产生的,如果某个州超过一半的选民支持希拉里,则她将赢得该州的支持。现在给出每个州的选民人数,请问希拉里至少需要赢得多少选民的支持才能当选?Input多组输入数据每组数据的第一行包括一个整数N(1<=N<=101),表示美国的州数,N=0表示输入结束接下来...

2019-07-28 22:25:54 86

空空如也

空空如也

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

TA关注的人

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