自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 B-智乃买瓜

链接:登录—专业IT笔试面试备考平台_牛客网来源:牛客网有一人前来买瓜。“哥们儿,这瓜多少钱一斤呐”“两块钱一斤”“What'sup,这瓜皮是金子做的,还是瓜粒子是金子做的”智乃来到水果摊前买瓜,水果摊上贩卖着N{N}N个不同的西瓜,第i{i}i个西瓜的重量为wiw_iwi​。智乃对于每个瓜都可以选择买一个整瓜或者把瓜劈开买半个瓜,半个瓜的重量为wi2\frac{w_i}{2}2wi​​。也就是说对于每个西瓜,智乃都有三种不同的决策:购买一整个重量为wiw_iwi​的西瓜 ..

2022-03-13 22:05:52 654

原创 H:小沙的数数

链接:登录—专业IT笔试面试备考平台_牛客网来源:牛客网有一个a数组,我们已知他的长度为n,a[+]的和为m,请问如果我们想要a[⊕]的值最大,数组a在满足a[+]=m时有多少种情况我们定义a[+]指a1+a2....ana_1+a_2....a_na1​+a2​....an​的值所以a[⊕]指a1a_1a1​⊕a2a_2a2​⊕a3a_3a3​....an....a_n....an​的值 其中a数组全部都为非负整数。答案...

2022-03-13 21:52:05 614

原创 B. GCD Arrays

Consider the arrayaacomposed of all the integers in the range[l,r][l,r]. For example, ifl=3l=3andr=7r=7, thena=[3,4,5,6,7]a=[3,4,5,6,7].Givenll,rr, andkk, is it possible forgcd(a)gcd(a)to be greater than11after doing the following operation...

2022-03-13 21:18:06 443

原创 B. Fun with Even Subarrays

You are given an arrayaaofnnelements. You can apply the following operation to it any number of times:Select some subarray fromaaof even size2k2kthat begins at positionll(1≤l≤l+2⋅k−1≤n1≤l≤l+2⋅k−1≤n,k≥1k≥1) and for eachiibetween00andk−1k−1...

2022-03-13 21:06:20 649

原创 E:炸鸡块君的高中回忆

题目来源:(牛客训练营)链接:登录—专业IT笔试面试备考平台_牛客网来源:牛客网炸鸡块君在高中时,学校规定进出校门必须要刷校园卡,否则禁止进入。某一天,炸鸡块君和同学们一共nnn个人去学校附近玩耍,但回学校时他们发现只有mmm个人带了校园卡,于是他们想到了这样一个策略:先让mmm个人带校园卡进入学校,再派一个人带着所有mmm张校园卡出来,重复上述过程,直到所有人进入学校。假设从外面进入学校和从校内出来到校外都需要花费一个单位的时间,求所有人都进入学校最少需要花费几个单位的时间。.

2022-03-13 20:56:02 94

原创 G - Mayor‘s posters

原题The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally decided to build an electoral wall for placing the po

2022-02-19 02:07:58 101

原创 F - Count Color

原题Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board with length L centimeter, L is a positive integer, so we can evenly divide the boar

2022-02-19 02:00:29 183

原创 J - 单源最短路

原题题目描述给一个 n(1 \leq n \leq 2500)n(1≤n≤2500) 个点 m(1 \leq m\leq 6200 )m(1≤m≤6200) 条边的无向图,求 ss 到 tt 的最短路。输入格式第一行四个由空格隔开的整数nn、mm、ss、tt。之后的mm行,每行三个正整数s_isi​、t_iti​、w_i(1 \leq w_i \leq 10 ^ 9)wi​(1≤wi​≤109),表示一条从s_isi​到t_iti​长度为w_iwi​的边。输出格式...

2022-02-19 01:54:43 389

原创 C - The Suspects

原题2019冠状病毒病(英语:Coronavirus disease 2019,缩写:COVID-19 ),是一种由严重急性呼吸系统综合症冠状病毒2型(缩写:SARS-CoV-2)引发的传染病。此病在全球各国大规模爆发并急速扩散,成为人类历史上致死人数最多的流行病之一。 很显然,目前最好的办法就是将所有可能的患者都隔离起来。 现在某高校正在排查可能的患者,这个高校中有多个社团,每个社团经常进行内部交流,一名学生可能会加入多个社团。学校认为一旦某个社团里出现一名可疑患者,这整个社团的学生都被视为是可能的患

2022-02-19 01:49:04 323

原创 I - Combinations

原题Computing the exact number of ways that N things can be taken M at a time can be a great challenge when N and/or M become very large. Challenges are the stuff of contests. Therefore, you are to make just such a computation given the following:GIVEN: 5

2022-02-19 01:45:12 116

原创 A - k-rounding

原题For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisible by n.For example, 4-rounding of 375 is 375·80 = 30000. 30000 is the minimum integer such that .

2022-02-19 01:39:31 350

原创 H - Discovering Gold

原题(Lightoj - 1030)You are in a cave, a deep cave! The cave can be represented by an1 x Ngrid. Some cells in the cave might contain gold!Initially, you are in position1. In each move, you throw a perfect6sided dice. If you getXin the dice after ...

2022-02-19 01:30:05 191

原创 C.开餐馆

原题(计蒜客 T-1224)蒜头君想开家餐馆. 现在共有nn个地点可供选择。蒜头君打算从中选择合适的位置开设一些餐馆。这nn个地点排列在同一条直线上。我们用一个整数序列m_1, m_2, ... m_nm1​,m2​,...mn​来表示他们的相对位置。由于地段关系, 开餐馆的利润会有所不同。我们用p_ipi​表示在m_imi​处开餐馆的利润。为了避免自己的餐馆的内部竞争,餐馆之间的距离必须大于kk。请你帮助蒜头君选择一个总利润最大的方案。输入格式标准的输入包含若干组...

2022-02-19 01:22:23 684

原创 B - 全排列

原题给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列。 我们假设对于小写字母有 'a' < 'b' < ... < 'y' < 'z',而且给定的字符串中的字母已经按照从小到大的顺序排列。输入格式输入只有一行,是一个由不同的小写字母组成的字符串,已知字符串的长度在 11 到 66 之间。输出格式输出这个字符串的所有排列方式,每行一个排列。要求字母序比较小的排列在前面。字母序如下定义:已知 S = s_1s_2...s_k, T = t_1t_2

2022-02-19 01:16:23 53

原创 I.滑动窗口

题意给一个长度为 NN 的数组,一个长为 KK 的滑动窗体从最左端移至最右端,你只能看到窗口中的 KK 个数,每次窗体向右移动一位,如下图:|窗口位置|最小值|最大值||:-:|:-:|:-:||\texttt{[1 3 -1] -3 5 3 6 7}[13-1]-35367|-1−1|33||\ \texttt{ 1 [3 -1 -3] 5 3 6 7}1[3-1-3]5367|-3−3|33||\ \texttt{ 1 3 [-1 -3 5] 3 6 7}...

2022-02-19 01:05:51 266

空空如也

空空如也

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

TA关注的人

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