自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Madoka and the Elegant Gift

Madoka’s father just reached 111 million subscribers on Mathub! So the website decided to send him a personalized award — The Mathhub’s Bit Button!The Bit Button is a rectangular table with nnn rows and mmm columns with 000 or 111 in each cell. After explo

2024-11-17 08:00:00 896

原创 The Lakes

You are given an n×mn \times mn×m grid aaa of non-negative integers. The value ai,ja_{i,j}ai,j​ represents the depth of water at the iii-th row and jjj-th column.A lake is a set of cells such that:The volume of a lake is the sum of depths of all the cells

2024-11-17 07:45:00 997

原创 Li Hua and Maze

There is a rectangular maze of size n×mn\times mn×m. Denote (r,c)(r,c)(r,c) as the cell on the rrr-th row from the top and the ccc-th column from the left. Two cells are adjacent if they share an edge. A path is a sequence of adjacent empty cells.Each cell

2024-11-17 07:45:00 985

原创 Destroying Bridges

There are nnn islands, numbered 1,2,…,n1, 2, \ldots, n1,2,…,n. Initially, every pair of islands is connected by a bridge. Hence, there are a total of n(n−1)2\frac{n (n - 1)}{2}2n(n−1)​ bridges.Everule lives on island 111 and enjoys visiting the other islan

2024-11-17 07:30:00 962

原创 Sakurako, Kosuke, and the Permutation

Sakurako’s exams are over, and she did excellently. As a reward, she received a permutation ppp. Kosuke was not entirely satisfied because he failed one exam and did not receive a gift. He decided to sneak into her room (thanks to the code for her lock) an

2024-11-16 08:00:00 868

原创 Permutation Game

The winner of the game is the player with the higher score after exactly turns.Bodya and Sasha found a permutation p1,…,pnp_1,\dots,p_np1​,…,pn​ and an array a1,…,ana_1,\dots,a_na1​,…,an​. They decided to play a well-known “Permutation game”.A permutation

2024-11-16 07:45:00 1325

原创 Colored Portals

There are nnn cities located on a straight line. The cities are numbered from 111 to nnn.Portals are used to move between cities. There are 444 colors of portals: blue, green, red, and yellow. Each city has portals of two different colors. You can move fro

2024-11-16 07:45:00 763 1

原创 Add Zeros

You’re given an array aaa initially containing nnn integers. In one operation, you must do the following:After performing this operation as many times as you want, what is the maximum possible length of the array aaa?Each test contains multiple test cases.

2024-11-16 07:30:00 780

原创 Knapsack 1

n个物品,选取其中若干个物品,使得对选取的这些物品∑wi​≤W的前提下最大化∑vi​。其实就是背包问题。

2024-11-09 08:00:00 271

原创 Knapsack 2

N个物品被编号为12N。对于1≤i≤N,物品i的重量是wi​,价值是vi​。太郎君决定从N个物品中选择一些放入背包中带回家。背包的容量为W,带回的物品的总重量不能超过W。请计算太郎君能带回的物品的最大总价值。

2024-11-09 08:00:00 650

原创 LCS

题目描述:给定一个字符串s和一个字符串t,输出s和t的最长公共子序列。输入格式:两行,第一行输入s,第二行输入t。输出格式:输出s和t的最长公共子序列。如果有多种答案,输出任何一个都可以。说明/提示:数据保证s和t仅含英文小写字母,并且s和t的长度小于等于3000。

2024-11-09 08:00:00 1689

原创 Nirvana

1ton。

2024-11-08 08:00:00 796

原创 Frog 1

N个石头,编号为12...N。对于每个i1≤i≤N,石头i的高度为hi​。最初有一只青蛙在石头1上。他将重复几次以下操作以到达石头Nii1i2∣hi​−hj​∣j找到青蛙到达石头N之前需要的最小总费用。

2024-11-08 08:00:00 1055

原创 Frog 2

河面上有N2≤N≤105块石头。有一只青蛙在第1块石头上,它想跳到第N块石头上。青蛙一次最多只能跳过K1≤K≤100块石头。从第i块跳到第j块需要花费青蛙abshi​−hj​的体力1≤hi​≤104。求青蛙到达第N块石头所耗费的最小体力值。

2024-11-08 08:00:00 1024

原创 Vacation

暑假有N天。对于每一天i1≤i≤Nai​bi​ci​由于太郎君容易厌倦,他不能连续两天及以上做同样的活动。请计算太郎君可以获得的最大总幸福度。

2024-11-08 08:00:00 793

原创 Marvolo Gaunt‘s Ring

【代码】Marvolo Gaunt‘s Ring。

2024-11-07 08:15:00 476

原创 Little Elephant and Interval

【代码】Little Elephant and Interval。

2024-11-07 08:00:00 638

原创 The World is a Theatre

【代码】The World is a Theatre。

2024-11-07 08:00:00 449

原创 Boredom

【代码】Boredom。

2024-11-07 08:00:00 564

原创 Dynasty Puzzles

【代码】Dynasty Puzzles。

2024-11-06 08:30:00 1084

原创 Basil‘s Garden

There are nnn flowers in a row, the iii-th of them initially has a positive height of hih_ihi​ meters.Every second, the wind will blow from the left, causing the height of some flowers to decrease.Specifically, every second, for each iii from 111 to nnn, i

2024-11-06 08:00:00 1585

原创 Cut Ribbon

【代码】Cut Ribbon。

2024-11-06 08:00:00 435

原创 Ice and Fire

Little09 and his friends are playing a game. There are nnn players, and the temperature value of the player iii is iii.The types of environment are expressed as 000 or 111. When two players fight in a specific environment, if its type is 000, the player wi

2024-11-06 07:45:00 957

原创 XXXXX

Ehab loves number theory, but for some reason he hates the number xxx. Given an array aaa, find the length of its longest subarray such that the sum of its elements isn’t divisible by xxx, or determine that such subarray doesn’t exist.An array aaa is a sub

2024-11-05 08:00:00 1034

原创 Erase First or Second Letter

Ehab loves number theory, but for some reason he hates the number xxx. Given an array aaa, find the length of its longest subarray such that the sum of its elements isn’t divisible by xxx, or determine that such subarray doesn’t exist.An array aaa is a sub

2024-11-05 08:00:00 994

原创 Colorful Table

You are given two integers nnn and kkk. You are also given an array of integers a1,a2,…,ana_1, a_2, \ldots, a_na1​,a2​,…,an​ of size nnn. It is known that for all 1≤i≤n1 \leq i \leq n1≤i≤n, 1≤ai≤k1 \leq a_i \leq k1≤ai​≤k.Define a two-dimensional array bbb

2024-11-05 08:00:00 987

原创 Trinity

You are given an array aaa of nnn elements a1,a2,…,ana_1, a_2, \ldots, a_na1​,a2​,…,an​.You can perform the following operation any number (possibly 000) of times:Find the minimum number of operations required to make the array aaa satisfy the condition:Ea

2024-11-04 08:45:00 995

原创 Medians

You are given an array a=[1,2,…,n]a = [1, 2, \ldots, n]a=[1,2,…,n], where nnn is odd, and an integer kkk.Your task is to choose an odd positive integer mmm and to split aaa into mmm subarrays†^{\dagger}† b1,b2,…,bmb_1, b_2, \ldots, b_mb1​,b2​,…,bm​ such th

2024-11-04 08:45:00 717

原创 Circuit

Alice has just crafted a circuit with nnn lights and 2n2n2n switches. Each component (a light or a switch) has two states: on or off. The lights and switches are arranged in a way that:Alice brings the circuit, which shows only the states of the 2n2n2n swi

2024-11-04 08:30:00 628

原创 Giving Directions in Harbin

【代码】Giving Directions in Harbin。

2024-11-04 08:30:00 758

原创 Diamond Miner

Diamond Miner is a game that is similar to Gold Miner, but there are nnn miners instead of 111 in this game.The mining area can be described as a plane. The nnn miners can be regarded as nnn points on the y-axis. There are nnn diamond mines in the mining a

2024-11-03 08:45:00 1470

原创 As Simple as One and Two

You are given a non-empty string s=s1s2…sns=s_1s_2\dots s_ns=s1​s2​…sn​, which consists only of lowercase Latin letters. Polycarp does not like a string if it contains at least one string “one” or at least one string “two” (or both at the same time) as a s

2024-11-03 08:00:00 781

原创 Ian and Array Sorting

To thank Ian, Mary gifted an array aaa of length nnn to Ian. To make himself look smart, he wants to make the array in non-decreasing order by doing the following finitely many times: he chooses two adjacent elements aia_iai​ and ai+1a_{i+1}ai+1​ (1≤i≤n−11

2024-11-03 08:00:00 942

原创 Suit and Tie

2nn2n。

2024-11-03 08:00:00 871

原创 Seating Arrangements (easy version)

It is the easy version of the problem. The only difference is that in this version n=1n = 1n=1.In the cinema seats can be represented as the table with nnn rows and mmm columns. The rows are numbered with integers from 111 to nnn. The seats in each row

2024-11-02 08:15:00 897

原创 【无标题】

You have a set of birthday cake candles. Each of such candles represents a digit between 000 and 999, inclusive. Example of birthday cake candles.Let’s denote the candle representing the digit ddd as ddd-candle.Your set contains c0c_0c0​ instances of 000-c

2024-11-02 08:00:00 1611

原创 Huge Boxes of Animal Toys

Chaneka has a hobby of playing with animal toys. Every toy has a different fun value, a real number. Chaneka has four boxes to store the toys with specification:Chaneka has AAA, BBB, CCC, DDD toys in the first, second, third, and fourth box, respectively.

2024-11-02 08:00:00 879

原创 Row GCD

You are given two positive integer sequences a1,…,ana_1, \ldots, a_na1​,…,an​ and b1,…,bmb_1, \ldots, b_mb1​,…,bm​. For each j=1,…,mj = 1, \ldots, mj=1,…,m find the greatest common divisor of a1+bj,…,an+bja_1 + b_j, \ldots, a_n + b_ja1​+bj​,…,an​+bj​.The f

2024-11-02 08:00:00 896

原创 AND 0, Sum Big

Baby Badawy’s first words were “AND 0 SUM BIG”, so he decided to solve the following problem. Given two integers nnn and kkk, count the number of arrays of length nnn such that:Since the answer can be very large, print its remainder when divided by 109+710

2024-11-02 07:30:00 1361

原创 Video Posts

Polycarp took nnn videos, the duration of the iii-th video is aia_iai​ seconds. The videos are listed in the chronological order, i.e. the 111-st video is the earliest, the 222-nd video is the next, …, the nnn-th video is the last.Now Polycarp wants to pub

2024-11-01 09:00:00 2821

空空如也

空空如也

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

TA关注的人

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