自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

蒟蒻的博客

捕获小白一只

  • 博客(12)
  • 收藏
  • 关注

原创 ubuntu server20.10安装mysql server8.0.22 没有密码也能登录的问题

原文:https://huangdf.xyz/MysqlServer8-0-22PassWordProblem.html前言:去年入手了一块树莓派4b,安装Ubuntu server20.10系统后,准备用tomcat部署下自己写的实训项目,但发现安装数据库的时候发生了小问题。在这儿记录下原因:root的插件(plugin)为auth_socket,这个插件不关心有没有密码,它只检查用户是否使用UNIX套接字进行连接,然后比较用户名。登录你的mysqlmysql或者mysql -u root选择

2021-01-23 16:59:03 263

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

原文链接别点我题意:进行Q组测试,在每组中有长度为n的数组a[i],然后现在给你一个K,问你找到一个bi使得|ai-bi|<=k并且bi最大。如果找不到,就输出-1.思路:这个也就关系到,最大值max,最小值min,和K,至于中间的数,我们不用去管,现在一个排序,如果max-min<=2k,那么就输出min+k,否者就输出-1。(为什么要在2k的范围找???想想看)代码:#in...

2019-06-27 02:48:57 285

原创 Codeforces Round #569 (Div. 2) B. Nick and Array

原文链接:别点我我怕疼题意:给你n个数,你要进行一次或者多次操作(操作的方式a[i]=-a[i]-1),让它们的乘积最大,当然也可以不进行操作,答案有多组。思路:根据(操作的方式a[i]=-a[i]-1),我们发现,正数进行操作后,绝对值变大了,那么想让全部数乘积最大,就让这组数全变成负数(是不是好奇,如果存在0的问题,0进行操作可以变为(-1)),然后判断个数n的奇偶,偶数就直接输出,奇数的...

2019-06-22 10:37:41 241

原创 Codeforces Round #567 (Div. 2) A.Chunga-Changa

原文链接:传送代码:#include"algorithm"#include"iostream"#include"cmath"using namespace std;long long x,y,z,ans;int main(){ while(cin>>x>>y>>z){ ans=0; long long s=0,i=0,j=0...

2019-06-16 20:13:25 174

原创 Codeforces Round #563 (Div. 2)C. Ehab and a Special Coloring Problem

原文链接:传送门    You’re given an integer n. For every integer i from 2 to n, assign a positive integer ai such that the following conditions hold:    For any pair ...

2019-06-04 19:37:00 114

原创 Codeforces Round #563 (Div. 2)B;Ehab Is an Odd Person

原文链接:任意门InputThe first line contains an integer n (1≤n≤10^5) — the number of elements in the array a。The second line contains n space-separated integers a1, a2, …, an (1≤ai≤10^9) — the elements of ...

2019-06-04 01:20:58 139

原创 Codeforces Global Round 3:B. Born This Way

Born This Way    原文链接:传送门Examplesinput4 5 1 1 21 3 5 71 2 3 9 10output11input2 2 4 4 21 1010 20output-1input4 3 2 3 11 999999998 999999999 10000000003 4 100000000...

2019-06-02 11:01:37 163

原创 poj 1611 :The Suspects经典的并查集题目

poj 1611 :The Suspects   Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-M...

2019-06-02 01:09:46 128

原创 优先队列题目集合

       看病要排队这个是地球人都知道的常识。 不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权...

2019-05-10 02:41:50 910

原创 水题Eating Soup

       A. Eating Souptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output    The three frie...

2019-05-10 02:24:52 500

原创 codeforces A. Zoning Restrictions Again

codeforcesA. Zoning Restrictions Againou are planning to build housing on a street. There are n spots available on the street on which you can build a house. The spots are labeled from 1 to n from l...

2019-05-08 09:08:46 363

原创 A. Serval and Bus

time limit per test1 second memory limit per test256 megabytesinputstandard inputoutputstandard outputIt is raining heavily. But this is the first day ...

2019-04-14 00:16:10 130

空空如也

空空如也

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

TA关注的人

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