自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 牛客练习赛67 E-牛妹游历城市

牛客练习赛67 E-牛妹游历城市链接:https://ac.nowcoder.com/acm/contest/6885/E来源:牛客网题目描述最近,牛妹天天宅在家里,真是憋死人了。他决定出去旅游。输入描述:本题有多组数据。第一行,输入一个数T,表示数据组数。接下来2*T行,先输入一个数n,再输入n个数,第i个数表示a i。输出描述:对于每组数据,输出最小的行走距离。如果无法从1号点到达n号点,则输出“Impossible”(不含引号)。示例1输入262 3 5 8 13

2020-08-17 14:42:08 289

原创 牛客练习赛67 D-牛妹爱数列

牛客练习赛67 D-牛妹爱数列链接:https://ac.nowcoder.com/acm/contest/6885/D来源:牛客网他手里有一个长度为n的序列a,保证它是一个01序列,并执行以下两种操作:1.单点修改:将位置x上的数翻转(0变1,1变0);2.前缀修改:将位置1~x上的数翻转(每个数都0变1,1变0)。他现在想要最小化翻转次数,使得数列上的所有数都变为0。链接:https://ac.nowcoder.com/acm/contest/6885/D来源:牛客网输入描述:第一行

2020-08-16 15:16:15 270

原创 HDU6862 Hexagon(2020杭电暑期多校训练第八场)

HexagonTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 167 Accepted Submission(s): 101Special JudgeProblem DescriptionIt is preferrable to read the pdf statment.If the world is a hexagon, I

2020-08-14 13:42:57 279

原创 HDU 6860 Fluctuation Limit(2020杭电多校暑期训练第八场)

Fluctuation LimitTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 268 Accepted Submission(s): 123Special JudgeProblem DescriptionIt is preferrable to read the pdf statment.Cuber QQ has signe

2020-08-14 13:17:43 216

原创 HDU 6857 Clockwise or Counterclockwise(2020杭电暑期多校训练第八场)

Clockwise or CounterclockwiseTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 112 Accepted Submission(s): 86Problem DescriptionIt is preferrable to read the pdf statment.After some basic geom

2020-08-14 09:40:15 136

原创 HDU 6828 Little Rabbit‘s Equation(2020杭电多校训练第六场)

Little Rabbit’s EquationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 593 Accepted Submission(s): 285Problem DescriptionLittle Rabbit is interested in radix. In a positional numeral system, t

2020-08-11 09:48:29 186

原创 K-The Flee Plan of Groundhog 2020牛客暑期多校训练营(第九场)

K-The Flee Plan of Groundhog题意:有一个土拨鼠在节点1,一个橘子在节点n,在t时刻之前土拨鼠向着n走,橘子不动,从t时刻开始,橘子开始抓土拨鼠,土拨鼠开始跑,土拨鼠 1m/s 橘子 2m/s,问还有多长时间橘子才能抓到土拨鼠。解题思路:t 时刻之后,土拨鼠必然朝着n的反方向移动,土拨鼠走一步,橘子走两步,那么我们可以记录一下t时刻土拨鼠的位置,还有土拨鼠向反方向最多能跑多远。然后分两种情况:土拨鼠向后跑到头了,等着被抓,那么显然答案是橘子到该点的距离/2向上取

2020-08-10 10:48:23 133

原创 I-The Crime-solving Plan of Groundhog2020牛客暑期多校训练营(第九场)

I-The Crime-solving Plan of Groundhog2020牛客暑期多校训练营(第九场)链接:https://ac.nowcoder.com/acm/contest/5674/I来源:牛客网题目描述Today, ZLZX has a mysterious case: Orange lost his down jacket hanging in his dorm room. Under the expectations of everyone, detective Groundh

2020-08-09 14:09:56 124

原创 F-Groundhog Looking Dowdy2020牛客暑期多校训练营(第九场)(尺取法)

F-Groundhog Looking Dowdy2020牛客暑期多校训练营(第九场)链接:https://ac.nowcoder.com/acm/contest/5674/F来源:牛客网Groundhog finds that Apple seems to be less intimate than before.He is very distressed for this.After pondering for a long time, Groundhog finds that he looks

2020-08-09 14:03:17 131

原创 E-Groundhog Chasing Death2020牛客暑期多校训练营(第九场)

链接:https://ac.nowcoder.com/acm/contest/5674/E来源:牛客网示例1输入1 2 1 2 8 4输出2048示例2输入1 2 3 4 120 180输出235140177备注:0⩽a,b,c,d⩽3×106 ,0<x,y⩽109 ,a⩽b,c⩽d.题意:求题解:这道题的思路历程真的是非常的久非常的久了,首先需要知道一个前提gcd的求法。比如30分解质因子是21*31*51,84的分解质因子是22*31*71.gcd(3

2020-08-09 11:28:19 130

原创 A-Groundhog and 2-Power Representation(2020牛客暑期多校训练营(第九场))

A-Groundhog and 2-Power Representation(2020牛客暑期多校训练营(第九场))输入描述:Given a string, indicating the power representation.输出描述:Output the original number.输入2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0)输出1315题意就是算这个输入公式的结果这里提供一个python的做法,还有很多c++的做法可

2020-08-09 10:04:43 154

原创 HDU 6835 Divisibility(2020杭电多校训练第六场)

HDU 6835 Divisibility

2020-08-08 09:40:08 134

原创 HDU6831 Fragrant numbers(区间dp)2020杭电多校第六场

HDU6831 Fragrant numbers(区间dp)2020杭电多校第六场Sample Input352012Sample Output612题意:“1145141919” 的无穷串,给出一个n,要求选最少的num,使得前num个数中间添加任意括号、加号、乘号,计算结果等于n。题解:区间dp+预处理dp[i][j][val]:[i,j]区间内是否能计算出valval。于是可得转移方程:dp[i][j][v1+v2]=dp[i][mid][v1]+dp[mid+1

2020-08-07 13:06:39 164

原创 2020上海高校程序设计竞赛暨第18届上海大学程序设计联赛夏季赛(同步赛)

链接:https://ac.nowcoder.com/acm/contest/6871/A来源:牛客网A 同源例如,有三个正整数 a, b, c 和某一个目标值 k,如果 gcd(a,b)=gcd(b,c)=gcd(a,c)=k,并且 a,b,c!=k,那么他认为这三个数是一组好数。 其中gcd(x,y)表示整数 x 和 y 的最大公约数。当然这不够刺激。现在 Compute 想要知道,如果已知三个数的和 n 和目标值 k,是否存在一组 a, b, c 可以让它们是一组好数。链接:https://

2020-08-07 09:08:04 642

原创 数论合集

扩展欧几里德ll exgcd(ll a,ll b,ll &x,ll &y){ if(b==0){ x=1; y=0; return a; } else{ ll r=exgcd(b,a%b,x,y); ll t; t=x; x=y; ...

2020-08-07 09:00:18 162

原创 牛客编程巅峰赛S1第3场 - 青铜&白银

A-位数求和链接:https://ac.nowcoder.com/acm/contest/6220/A来源:牛客网牛牛想知道所有的长度为n的数中,各个位上的数字之和为m的这些数的和是多少呢。给定n和m,求这些数的和。C++(暴力模拟)class Solution {public: /** * 返回这样的数之和 * @param n int整型 数的长度 * @param m int整型 各个为之和 * @return long长整型 *

2020-08-07 08:59:42 139

原创 HDU6759 Leading Robots(杭电多校第一场)

Leading RobotsHDU6759 Leading RobotsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1811 Accepted Submission(s): 504Problem DescriptionSandy likes to play with robots. He is going to organiz

2020-08-07 08:59:20 212

原创 2020牛客暑期多校训练营(第八场) I-Interesting Computer Game

I-Interesting Computer Game题意详细题解有两个数组{a1,a2,a3,an},{b1,b2,b3,bn}第i步可以从ai和bi中取出一个值求最终取出不同的数的最多个数Code:离散化是因为ab 的范围太大了,所以按他们的大小排序,离散化#include<iostream>#include<cstdio>#include<cstring>#include<stack>#include<algorithm&g

2020-08-05 10:32:47 157

原创 K-Kabaleo Lite 2020牛客暑期多校训练营(第八场)

输入232 -1 33 2 143 -2 3 -14 2 1 2输出Case #1: 3 8Case #2: 4 13说明For test case 1, the maximum number of visitors is 3, one of apossible solution is: The first visitor received food 1, the profit is2. The second visitor received food 1, the pr.

2020-08-04 19:19:57 254

原创 2020牛客暑期多校训练营(第八场)G Game SET

链接:https://ac.nowcoder.com/acm/contest/5673/G来源:牛客网SET is a real-time card game designed by Marsha Falco in 1974 and published by Set Enterprises in 1991. The deck consists of 81 unique cards that vary in four features across three possibilities for each

2020-08-04 18:42:03 182

原创 HDU 6798 Triangle Collision(2020杭电多校训练第三场)

Triangle CollisionTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1091 Accepted Submission(s): 336Special JudgeProblem DescriptionSample Input44000 0 1732 1000 0 14000 0 1732 1000 0

2020-08-04 11:54:13 187

原创 I Parentheses Matching(2020杭电多校训练第三场)

I Parentheses Matching(2020杭电多校训练第三场)Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 792 Accepted Submission(s): 345Problem DescriptionGiven a string P consisting of only parentheses and aste

2020-08-02 18:22:49 168

原创 G Tokitsukaze and Rescue(2020杭电多校训练第三场)

Tokitsukaze and RescueTime Limit: 8000/8000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1315 Accepted Submission(s): 512Problem DescriptionPrincess CJB has lived almost her entire life in the isolated town of

2020-08-02 11:21:34 342 1

原创 2020牛客暑期多校训练营(第七场)B-Mask Allocation

2020牛客暑期多校训练营(第七场)B-Mask Allocation链接:https://ac.nowcoder.com/acm/contest/5672/B来源:牛客网Nowadays, the Kingdom of Dreamgrid is suffering from a national pandemic. Fortunately, president Baobao is working effectively with the Center for Disease Control (CDC

2020-08-01 21:55:10 1150

原创 2020牛客暑期多校训练营(第七场)H Divding

2020牛客暑期多校训练营(第七场)H Divding链接:https://ac.nowcoder.com/acm/contest/5672/H来源:牛客网题目描述The following rules define a kind of integer tuple - the Legend Tuple:(1, k) is always a Legend Tuple, where k is an integer.if (n, k) is a Legend Tuple, (n + k, k) is

2020-08-01 20:49:49 214

原创 2020牛客暑期多校训练营(第七场)D Fake News

2020牛客暑期多校训练营(第七场)D Fake News链接:https://ac.nowcoder.com/acm/contest/5672/D来源:牛客网McDonald Thumb, the greatest president ever in the history of the Great Tokitsukaze Kingdom has held his 100th press conference about the global pandemic after making his 10

2020-08-01 18:02:58 193

空空如也

空空如也

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

TA关注的人

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