自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 hdu5956 The Elder (树型dp, 斜率优化)

传送门:The Elder - HDU 5956 - Virtual JudgeOnce upon a time, in the mystical continent, there is a frog kingdom, ruled by the oldest frog, the Elder. The kingdom consists of N cities, numbered from east to west. The 1-th city, which is located to the east .

2022-05-18 22:59:17 162

原创 G.Cyclic Buffer(数据结构优化 dp 澳门站2022)

链接:登录—专业IT笔试面试备考平台_牛客网来源:牛客网有一个大小为 nnn 的循环缓冲区,读取器从第 111 个位置到第 kkk 个位置(包括两者)。令 aia_iai​ (1≤i≤n1 \le i \le n1≤i≤n) 为缓冲区最初第 iii 个位置的整数。此外,a1,a2,⋯,ana_1, a_2, \cdots, a_na1​,a2​,⋯,an​ 形成了 nnn 的一个排列。我们将按升序访问从 111 到 nnn(包括两者)的所有整数。一个整数只有在它位于读者的位置时才能被访问(也就..

2022-04-24 17:43:31 757

原创 D. Infinite Set(线性dp)

Problem - D - CodeforcesD. Infinite Settime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an arrayaaconsisting ofnndistinctpositive integers.Let's consider an infi...

2022-02-21 17:39:42 821

原创 E. Cars (二分图染色, 拓扑排序,有向无环图的判定)

Problem - 1635E - Codeforces#include <iostream>#include <algorithm>#include <cstring>#include <set>#include <unordered_map>#include <vector>#include <queue>#include <functional>#include <cstdio&

2022-02-21 17:36:57 289

原创 E. Tree Painting(换根dp)

Problem - 1187E - CodeforcesE. Tree Paintingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a tree (an undirected connected acyclic graph) consisting ofnnvertices. Y...

2021-12-25 19:03:08 223

原创 E. Purple Crayon ( 按权剖分)

E. Purple Crayontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo players, Red and Blue, are at it again, and this time they're playing with crayons! The mischievous duo is now vand.

2021-12-25 18:55:00 267

原创 D. Yet Another Sorting Problem(逆序对, 偶排列)

Problem - D - CodeforcesD. Yet Another Sorting Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya has an array of integersa1,a2,…,ana1,a2,…,an. He only likes sorted array..

2021-12-13 15:59:54 610

原创 小 A 的卡牌游戏(dp, 贪心)

传送门:小 A 的卡牌游戏 - Gym 103186B - Virtual Judge小 A 最近沉迷于一款名为 Hearthverse 的卡牌游戏。在这款游戏中,卡被分为了三个种类(随从、法术和魔法阵),在组卡时,这款游戏严格规定了卡组中每种卡牌的数量,具体来说,一副nn张卡的卡组需要包含恰好aa张随从卡,bb张法术卡和cc张魔法阵卡,并且a + b + c = na+b+c=n。在游戏中,有一个叫做 "3pick" 的组卡竞技方式,游戏会给出nn次三选一的机会,三张卡分...

2021-11-26 17:03:35 3179

原创 Play Game (HDU 4597)(dp, 记忆化搜索)

题目:Play Game - HDU 4597 - Virtual JudgeAlice and Bob are playing a game. There are two piles of cards. There are N cards in each pile, and each card has a score. They take turns to pick up the top or bottom card from either pile, and the score of the.

2021-10-19 09:31:19 166

原创 cf1455 D. Sequence and Swaps(dp, 思维)

题目:Problem - 1455D - Codeforcestime limit per test1.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a sequenceaaconsisting ofnnintegersa1,a2,…,ana1,a2,…,an, and an integerxx. Your t...

2021-10-14 16:25:56 148

原创 Gym 101532 contest (未完)

个人总结,如果有错的地方,欢迎大佬纠正。A - Subarrays BeautyYou are given an arrayaconsisting ofnintegers. A subarray(l, r)from arrayais defined as non-empty sequence of consecutive elementsal, al + 1, ..., ar.The beauty of a subarray(l, r)is calculated as t...

2021-04-28 08:56:17 323

原创 B. Max and Mex Codeforces Round #706 (Div. 2)

B. Max and Mextime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a multisetSSinitially consisting ofnndistinct non-negative integers. A multiset is a set, that can contai...

2021-03-10 22:57:45 392

原创 A. Split it! Codeforces Round #706 (Div. 2)

A. Split it!time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKawashiro Nitori is a girl who loves competitive programming.One day she found a string and an integer. As an advanced prob

2021-03-10 22:51:19 178

原创 B. Planet Lapituletti Codeforces Round #705 (Div. 2)

B. Planet Lapitulettitime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe time on the planet Lapituletti goes the same way it goes on Earth but a day lastshhhours and each hour lasts...

2021-03-07 17:30:38 214

原创 A. Anti-knapsack  Codeforces Round #705 (Div. 2)

A. Anti-knapsack Codeforces Round #705 (Div. 2)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integersnnandkk. You are asked to choose maximum number of distinct ...

2021-03-07 17:14:44 280

原创 洛谷 P1303 A*B Problem (高精度乘法)

洛谷 P1303 A*B Problem (高精度乘法)题目描述求两数的积。输入格式两行,两个整数。输出格式一行一个整数表示乘积。输入输出样例输入 #1复制1 2输出 #1复制2说明/提示每个数字不超过10^{2000}102000,需用高精。AC代码:两个大整数相加,先求每个数,最后在算进位。#include <iostream>#include <string>#include <algorit..

2021-03-06 16:07:42 212

原创 洛谷 P2142 高精度减法

洛谷 P2142 高精度减法题目描述高精度减法。输入格式两个整数a,ba,b(第二个可能比第一个大)。输出格式结果(是负数要输出负号)。输入输出样例输入 #1复制21输出 #1复制1说明/提示20\%20%数据a,ba,b在 long long 范围内; 100\%100%数据0<a,b\le 10^{10086}0<a,b≤1010086。AC代码:#include <iostream>#inc...

2021-03-06 15:19:19 165

原创 洛谷 P1601 A+B Problem(高精度加法)

洛谷 P1601 A+B Problem(高精度加法)题目描述高精度加法,相当于a+b problem,不用考虑负数.输入格式分两行输入。a,b \leq 10^{500}a,b≤10500输出格式输出只有一行,代表a+ba+b的值输入输出样例输入 #1复制11输出 #1复制2输入 #2复制10019099输出 #2复制10100AC代码:#include <iostream>#include <strin

2021-03-05 21:57:21 166

原创 Monthly Expense (POJ - 3273)(整数二分)

Monthly Expense (POJ - 3273)(整数二分)Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that he will need to sp...

2021-03-05 17:20:43 107

原创 As Easy As A+B (HDU - 1040)(快速排序)

As Easy As A+B (HDU - 1040)(快速排序)These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to sort.

2021-03-05 16:57:33 338

空空如也

空空如也

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

TA关注的人

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