自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces Round #818 (Div. 2) A、C

思维,lcm,gcd

2022-09-04 17:46:07 169 1

原创 Codeforces Round #817 (Div. 4) E、F、G

二维数组的前缀和,DFS,按位与的特点

2022-09-04 13:15:14 254

原创 KMP算法

KMP算法,next数组,nextval数组

2022-08-29 23:38:51 616

原创 图的四种存储方式

邻接矩阵、边集数组、邻接表、链式前向星

2022-08-24 23:17:39 899

原创 数据结构 —— 树

关于树

2022-08-07 22:33:05 2045

原创 codeforces#803(Div2) A-C

思维、无符号数与负数

2022-07-14 18:49:43 304

原创 codeforces #806(div4) G. Good Key, Bad Key

贪心

2022-07-13 17:34:10 361

原创 二分查找与二分答案

二分查找与二分答案

2022-07-12 21:10:40 594

原创 牛客 丢手绢

“丢~丢~丢手绢,轻轻地放在小朋友的后面,大家不要告诉她,快点快点抓住她,快点快点抓住她。”牛客幼儿园的小朋友们围成了一个圆圈准备玩丢手绢的游戏,但是小朋友们太小了,不能围成一个均匀的圆圈,即每个小朋友的间隔可能会不一致。为了大家能够愉快的玩耍,我们需要知道离得最远的两个小朋友离得有多远(如果太远的话牛老师就要来帮忙调整队形啦!)。因为是玩丢手绢,所以小朋友只能沿着圆圈外围跑,所以我们定义两个小朋友的距离为沿着圆圈顺时针走或者逆时针走的最近距离。第一行一个整数N,表示有N个小朋友玩丢手绢的游戏。接下来的第

2022-07-02 10:43:14 273

原创 牛客 货仓选址

在一条数轴上有N家商店,它们的坐标分别为 A[1]~A[N]。现在需要在数轴上建立一家货仓,每天清晨,从货仓到每家商店都要运送一车商品。为了提高效率,求把货仓建在何处,可以使得货仓到每家商店的距离之和最小。第一行一个整数N,第二行N个整数A[1]~A[N]。输出描述:一个整数,表示距离之和的最小值。输入46 2 9 1输出12备注:对于100%的数据:N≤100000, A[i]≤1000000——————————————————————————

2022-07-02 09:31:19 182

原创 牛客 二分

差分

2022-07-01 19:42:48 122

原创 牛客[CQOI2009]中位数图

给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b。中位数是指把所有元素从小到大排列后,位于中间的数。第一行为两个正整数n和b ,第二行为1~n 的排列。输出描述:输出一个整数,即中位数为b的连续子序列个数。输入7 45 7 2 4 3 1 64对于30%的数据中,满足 n≤100;对于60%的数据中,满足 n≤1000;对于100%的数据中,满足 n≤100000,1≤b≤n。————————————————————

2022-06-30 11:53:53 361

原创 牛客网[NOIP2016]回文日期

在日常生活中,通过年、月、日这三个要素可以表示出一个唯一确定的日期。牛牛习惯用8位数字表示一个日期,其中,前4位代表年份,接下来2位代表月份,最后2位代表日期。显然:一个日期只有一种表示方法,而两个不同的日期的表示方法不会相同。牛牛认为,一个日期是回文的,当且仅当表示这个日期的8位数字是回文的。现 在,牛牛想知道:在他指定的两个日期之间包含这两个日期本身),有多少个真实存在的日期是回文的。一个8位数字是回文的,当且仅当对于所有的i ( 1 ...

2022-06-18 19:13:47 346

原创 Codeforces#799(Div4)F. 3SUM

Given an array a of positive integers with length n, determine if there exist three distinct indices i, j, k such that ai+aj+ak ends in the digit 3.InputThe first line contains an integer t (1≤t≤1000) — the number of test cases.The first line of each test

2022-06-17 23:37:12 444

原创 Codeforces#799(Div4)E. Binary Deque

Slavic has an array of length n consisting only of zeroes and ones. In one operation, he removes either the first or the last element of the array.What is the minimum number of operations Slavic has to perform such that the total sum of the array is equal

2022-06-17 21:13:33 566

原创 Codeforces 799(Div.4) D. The Clock

Victor has a 24-hour clock that shows the time in the format "HH:MM" (00 ≤ HH ≤ 23, 00 ≤ MM ≤ 59). He looks at the clock every x minutes, and the clock is currently showing time s.How many different palindromes will Victor see in total after looking at the

2022-06-16 17:33:01 355

原创 Codeforces 797(div3)E. Price Maximization

A batch of n goods (n — an even number) is brought to the store, i-th of which has weight ai. Before selling the goods, they must be packed into packages. After packing, the following will be done:With this, the cost of a package of weight x is always ⌊x/k

2022-06-09 23:32:34 266

原创 Codeforce A. Everything Everywhere All But One

You are given an array ofnnintegersa1,a2,…,ana1,a2,…,an. After you watched the amazing film "Everything Everywhere All At Once", you came up with the following operation.In one operation, you choosen−1n−1elements of the array and replace each ...

2022-05-29 17:01:49 314

空空如也

空空如也

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

TA关注的人

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