自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

WhileTrue

古之成大事者,不惟有超世之才,亦必有坚忍不拔之志

  • 博客(231)
  • 资源 (1)
  • 收藏
  • 关注

原创 Data truncation: Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column xxx

一、保存原因出现这个报错的问题是,当数据库的表中已经有数据的时候,再添加一个datetime类型的字段,并且设置为不允许为null,就会出现此异常。经测试,其他类型的字段没有出现此问题,只发现datetime类型字段会出现。二、解决方法。1、修改数据库配置,设置sql_modeset @@global.sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE...

2022-01-07 10:09:49 4112 1

原创 js版飞机大战

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>飞机大战</title> <style> div { margin: 0 auto; text-align: center; } </...

2020-04-24 18:38:32 641 2

原创 HPU-17-python8个实验

1.日期转化(11月为例)#2019.11;import mathwhile True : weekstr = "星期一星期二星期三星期四星期五星期六星期日" date = eval(input("请输入日期数字(1-30)")) pos = (date - 1 + 4) % 7#第11月的1号是周五 pos = pos * 3 cnt = mat...

2019-12-05 22:39:56 509

原创 Codeforces Round #570 (Div. 3)B. Equalize Prices

原题出处:http://codeforces.com/contest/1183/problem/BThere arennproducts in the shop. The price of theii-th product isaiai. The owner of the shop wants to equalize the prices of all products. Howev...

2019-07-31 15:07:54 204

原创 Codeforces Round #570 (Div. 3)C. Computer Game

原题地址:http://codeforces.com/contest/1183/problem/CVova is playing a computer game. There are in totalnnturns in the game and Vova really wants to play all of them. The initial charge of his laptop ...

2019-07-31 15:05:50 172

原创 Codeforces Round #570 (Div. 3)D. Candy Box (easy version)

原题出处:http://codeforces.com/contest/1183/problem/DThis problem is actually a subproblem of problem G from the same contest.There arenncandies in a candy box. The type of theii-th candy isaiai(...

2019-07-31 09:32:35 203

原创 Codeforces Round #570 (Div. 3)E. Subsequences (easy version)

原题出处:http://codeforces.com/contest/1183/problem/EThe only difference between the easy and the hard versions is constraints.A subsequence is a string that can be derived from another string by dele...

2019-07-31 09:28:18 299

原创 Codeforces Round #570 (Div. 3)F. Topforces Strikes Back

原题出处:http://codeforces.com/contest/1183/problem/FOne important contest will take place on the most famous programming platform (Topforces) very soon!The authors have a pool ofnnproblems and shou...

2019-07-31 09:11:53 217

原创 Codeforces Round #570 (Div. 3)G. Candy Box (hard version)

原题出处:http://codeforces.com/contest/1183/problem/GThis problem is a version of problem D from the same contest with some additional constraints and tasks.There arenncandies in a candy box. The ty...

2019-07-30 20:25:36 261 1

原创 Codeforces Round #570 (Div. 3)H. Subsequences (hard version)

原题出处:http://codeforces.com/contest/1183/problem/HThe only difference between the easy and the hard versions is constraints.A subsequence is a string that can be derived from another string by dele...

2019-07-30 18:10:43 4340

转载 算符优先分析法设计与实现——程序设计与编译原理

1.定义目标语言的语法规则; 例如:E->E+T|T T->T*F|F F->(E)|i2.求解预测分析方法需要的符号集和分析表; 终结符集合为:{+,*,(,i,)} 非终结符集为:{E,T,F} 算符优先分析表为 + * i ( ) ...

2019-06-17 11:09:50 3217

原创 Codeforces Round #544 (Div. 3)E. K Balanced Teams

time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are a coach at your local university. There arennstudents under your supervi...

2019-04-27 22:47:50 159

原创 Codeforces Round #547 (Div. 3)B. Maximal Continuous Rest

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEach day in Berland consists ofnnhours. Polycarp likes time management. That's w...

2019-04-17 23:04:40 114

原创 Codeforces Round #547 (Div. 3)C. Polycarp Restores Permutation

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn array of integersp1,p2,…,pnp1,p2,…,pnis called apermutationif it contains e...

2019-04-17 22:58:54 125

原创 Codeforces Round #547 (Div. 3)D. Colored Boots

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arennleft boots andnnright boots. Each boot has a color which is denoted...

2019-04-17 22:46:04 106

原创 Codeforces Round #547 (Div. 3)E. Superhero Battle

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA superhero fights with a monster. The battle consists of rounds, each of which la...

2019-04-17 22:30:27 128

原创 Codeforces Round #547 (Div. 3)F1. Same Sum Blocks (Easy)

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis problem is given in two editions, which differ exclusively in the constraints...

2019-04-17 22:23:02 122

原创 Codeforces Round #552 (Div. 3) B. Make Them Equal

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequencea1,a2,…,ana1,a2,…,anconsisting ofnnintegers.You can ...

2019-04-17 22:11:40 181

原创 Codeforces Round #552 (Div. 3) C题

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he...

2019-04-17 19:18:16 276

原创 E. Median String

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two stringsssandtt, both consisting of exactlykklowercase Latin...

2019-04-11 22:12:13 116

原创 Tickets

You have won a collection of tickets on luxury cruisers. Each ticket can be used only once, but can be used in either direction between the 2 different cities printed on the ticket. Your prize gives y...

2019-04-08 20:35:06 227

原创 Min Number

Now you are given one non-negative integer n in 10-base notation, it will only contain digits ('0'-'9'). You are allowed to choose 2 integers i and j, such that: i!=j, 1≤i<j≤|n|, here |n| means the...

2019-04-08 18:43:44 120

原创 Beauty of Array(找规律)

Edward has an arrayAwithNintegers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous ...

2019-04-07 00:09:43 257

原创 Team Formation

For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team fromNstudents of his university.Edward knows the skill level of each student. He has fou...

2019-04-06 23:33:15 204

原创 L. 最优规划

单测试点时限:1.0 秒内存限制:512 MB有很多城市之间已经建立了路径,但是有些城市之间没有路径联通。为了联通所有的城市,现在需要添加一些路径,为了节约,需要满足添加总路径是最短的。输入第一行3个整数n,m,s, 分别表示城市的数量、已经存在的路的数量、可修的路的数量。之后的m行,每行3个整数x,y,d,表示点x到点y有一条长度为d的已...

2019-04-02 09:39:34 640

原创 J. 简单递归

单测试点时限:1.0 秒内存限制:512 MB这是一段 C/C++ 代码,用于计算递推数列an的。const int MOD = (int)1e9 + 7;int a(int n) { if(n < 3) return 1; return ((a(n - 1) << 1) % MOD + (a(n - 2) >> 1)) % M...

2019-04-01 22:48:02 185

原创 H. Mo的面积

单测试点时限:1.0 秒内存限制:512 MBMo的老师给了他两个矩形,让他求两个矩形的面积并。Mo很忙没时间解决这种小case,请你帮他解决。输入输入两行,每行四个整数x,y,x1,y1。(x,y)是矩形左下角,(x1,y1)是矩形的右上角.(0≤x,y,x1,y1≤1000)。输出输出一个整数表示二个矩形的面积并。样例input0 1 2 3...

2019-04-01 22:44:44 146

原创 E. Mo的游戏

单测试点时限:1.0 秒内存限制:512 MBMo翻书看到一种新的连连看游戏:对于一个字符串来说,只有当两个字符相同时候才可以进行相连,得分为字符串的长度减去两个相连字符的距离(如果整个字符串中某一种字符个数为1,那么不能相连故得分为0)。Mo现在在玩这个游戏,但是Mo不知道该选择哪一种字符进行相连,所以请你列出每种字符相连可以获得的最大分数,以此来让Mo进行参考。输入一个字符...

2019-04-01 22:21:33 294

原创 C. Asia区域宫

单测试点时限:1.0 秒内存限制:512 MB远古洪荒时期,女王Alice和战神Bob因爱相恋,一段催人泪下的爱情故事流传民间.相传,女王Alice的美貌惊艳六界,作为对颜值颇有要求的上古灵兽Qaq芳心异动,可是女王早已许配给战神Bob,怎么会移情于己呢,而且单挑自己也不是战神Bob的对手。于是,灵兽Qaq便设计将战神Bob引入洪荒之地,种下十里桃花困住战神Bob。女王Alice得知...

2019-04-01 22:16:00 208 1

原创 B. Asia区域制(16进制转化)

单测试点时限:1.0 秒内存限制:512 MB二进制数据是用0和1两个数码来表示的数.它的基数为2,进位规则是“逢二进一”,借位规则是“借一当二”,由18世纪德国数理哲学大师莱布尼兹发现.十六进制(简写为hex或下标16)在数学中是一种逢16进1的进位制.一般用数字0到9和字母A到F(或a~f)表示,其中:a~f表示10~1...

2019-04-01 21:38:48 351

原创 问题 1163: 【排队买票】

时间限制: 1Sec 内存限制: 128MB 提交: 484 解决: 199题目描述有M个小孩到公园玩,门票是1元。其中N个小孩带的钱为1元,K个小孩带的钱为2元。售票员没有零钱,问这些小孩共有多少种排队方法,使得售票员总能找得开零钱。注意:两个拿一元零钱的小孩,他们的位置互换,也算是一种新的排法。(M<=10)输入输入一行,M,N,K(其中M=N+K,M<=10)....

2019-03-29 17:10:51 513

原创 问题 1168: 【简单计算】

时间限制: 1Sec 内存限制: 128MB 提交: 378 解决: 122题目描述有一个n+2个元素a[0], a[1], ..., a[n+1] (n <= 3000, -1000 <= a[i] <=1000)构成的数列.已知对i=1, 2, ..., n有a[i] = (a[i-1] + a[i+1])/2 - c[i].给定a0, a[n+1], c[1],...

2019-03-29 15:23:04 561

原创 问题 1160: 【出圈】(约瑟夫环)

时间限制: 1Sec 内存限制: 128MB 提交: 1209 解决: 426题目描述设有n个人围坐一圈并按顺时针方向从1到n编号,从第1个人开始进行1到m的报数,报数到第个m人,此人出圈,再从他的下一个人重新开始1到m的报数,如此进行下去直到所剩下一人为止。输入输入多行,每行2个数,分别表示n和m.输出计算每一行中最后剩下这个人的编号.样例输入10 3样例输...

2019-03-27 21:09:34 434

原创 问题 1161: 【回文数(二)】

时间限制: 1Sec 内存限制: 128MB 提交: 571 解决: 221题目描述若一个数(首位不为零)从左向右读与从右向左读都一样,我们就将其称之为回文数。例如:给定一个10进制数56,将56加65(即把56从右向左读),得到121是一个回文数。又如:对于10进制数87:STEP1:87+78 = 165         STEP2:165+561 = 726STEP3...

2019-03-26 21:48:41 194

原创 7-12 最长对称子串 (25 分)

对给定的字符串,本题要求你输出最长对称子串的长度。例如,给定Is PAT&TAP symmetric?,最长对称子串为s PAT&TAP s,于是你应该输出11。输入格式:输入在一行中给出长度不超过1000的非空字符串。输出格式:在一行中输出最长对称子串的长度。输入样例:Is PAT&TAP symmetric?输出样例:11...

2019-03-26 21:44:44 1804 1

原创 高斯日记

大数学家高斯有个好习惯:无论如何都要记日记。他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210。后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢?  高斯出生于:1777年4月30日。在高斯发现的一个重要定理的日记上标注着:5343,因此可算出那...

2019-03-23 11:45:42 100

原创 [蓝桥杯][算法训练VIP]一元三次方程求解

时间限制: 1Sec 内存限制: 128MB 提交: 21 解决: 7题目描述有形如:ax3+bx2+cx+d=0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-100至100之间),且根与根之差的绝对值> =1。要求三个实根。数据规模和约定|a|,|b|,|c|,|d|< =20输入...

2019-03-21 22:34:39 531 1

原创 [蓝桥杯][基础练习VIP]矩阵乘法

给定一个N阶矩阵A,输出A的M次幂(M是非负整数)例如:A =1 23 4A的2次幂7 1015 22输入第一行是一个正整数N、M(1< =N< =30, 0< =M< =5),表示矩阵A的阶数和要求的幂数接下来N行,每行N个绝对值不超过10的非负整数,描述矩阵A的值输出输出共N行,每行N个整数,表示A的M次幂...

2019-03-21 22:00:37 299

原创 [蓝桥杯][基础练习VIP]报时助手

时间限制: 1Sec 内存限制: 128MB 提交: 36 解决: 12题目描述给定当前的时间,请用英文的读法将它读出来。时间用时h和分m表示,在英文的读法中,读一个时间的方法是:如果m为0,则将时读出来,然后加上“o'clock”,如3:00读作“three o'clock”。如果m不为0,则将时读出来,然后将分读出来,如5:30读作“five thirty”。时和分...

2019-03-21 21:57:34 114

原创 [蓝桥杯][算法训练VIP]字串统计

时间限制: 1Sec 内存限制: 128MB 提交: 28 解决: 8题目描述给定一个长度为n的字符串S,还有一个数字L,统计长度大于等于L的出现次数最多的子串(不同的出现可以相交),如果有多个,输出最长的,如果仍然有多个,输出第一次出现最早的。数据规模和约定n< =60S中所有字符都是小写英文字母。提示枚举所有可能的子串,统计出现次数,找出符合条件的那个输...

2019-03-20 22:46:59 230

用js实现的飞机大战的代码以及素材分享给大家

用js实现的飞机大战的代码以及素材分享给大家

2020-04-24

空空如也

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

TA关注的人

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