02 2024 档案
摘要:错综的统一 题目描述 小红拿到了一个仅由 'r'、'e'、'd' 三种字母组成的矩阵,共 $n$ 行 $m$ 列。 小红定义一个矩形区域是美丽的,当且仅当:在该矩形区域中,任意横向或者纵向取一个长度大于1的连续子串时,该字符串都不是回文的。 现在小红有若干次询问,每次给定一个矩形区域,问最少修改多少
阅读全文
摘要:THUSCH2017] 大魔法师 题目描述 大魔法师小 L 制作了 $n$ 个魔力水晶球,每个水晶球有水、火、土三个属性的能量值。小 L 把这 $n$ 个水晶球在地上从前向后排成一行,然后开始今天的魔法表演。 我们用 $A_i,B_i,C_i$ 分别表示从前向后第 $i$ 个水晶球(下标从 $1$
阅读全文
摘要:C. Sasha and Array Sasha has an array of integers $a_1, a_2, \ldots, a_n$. You have to perform m queries. There might be queries of two types: $1$ $l$
阅读全文
摘要:tomorin的字符串迷茫值 题目描述 tomorin定义一个字符串的迷茫值为该字符串包含"mygo"连续子串的个数。例如"mygomygo"、"itsmygo"的迷茫值分别为 2,1,而"bangdream"的迷茫值为 0。 现在tomorin有一个字符串,她准备删除一些字符,但不能删除两个连续字
阅读全文
摘要:方块掉落 题目描述 最近阿宁对一个名叫“方块掉落”的游戏感兴趣,沉迷于此。 每局游戏一开始,有一条无限长的水平线、一个箭头、一个操作序列 $t$,没有任何方块。 操作序列 $t$ 是一个字符串,仅包含"YBR"三种字符,分别代表颜色黄蓝红。依次按照操作序列 $s$ 掉落不同颜色的方块。 如果即将掉落
阅读全文
摘要:G. Moving Platforms There is a game where you need to move through a labyrinth. The labyrinth consists of $n$ platforms, connected by $m$ passages. Ea
阅读全文
摘要:F - Breakdown Problem Statement You are given a simple undirected graph consisting of $N$ vertices and $M$ edges. For $i = 1, 2, \ldots, M$, the $i$-t
阅读全文
摘要:Minimize OR of Remaining Elements Using Operations You are given a 0-indexed integer array nums and an integer k. In one operation, you can pick any i
阅读全文
摘要:小苯的逆序对 题目描述 小苯有一个长度为 $n$ 的排列 $p$。他很想知道这个排列中有多少个逆序对满足互素。 形式化的,有多少个满足 $(i<j)$ 且 $(a_i > a_j)$ 且 $gcd(a_i, a_j) = 1$ 的 $(i, j)$ 对。 输入描述: 输入包含两行。 第一行一个正整数
阅读全文
摘要:D. Sasha and a Walk in the City Sasha wants to take a walk with his girlfriend in the city. The city consists of $n$ intersections, numbered from $1$
阅读全文
摘要:数组成鸡 题目描述 小鸡有一个由整数组成的数组,小鸡可以对这个数组进行任意次(可以不进行)全数组每个数加一或全数组每个数减一的操作。 现在,小鸡想让你回答 $Q$ 次询问,每次询问给出一个整数 $M$,你需要回答任意次(可以不操作)操作后是否可以使得给定数组的乘积等于给出的整数 $M$。 输入描述:
阅读全文
摘要:G. One-Dimensional Puzzle You have a one-dimensional puzzle, all the elements of which need to be put in one row, connecting with each other. All the
阅读全文
摘要:D. Lonely Mountain Dungeons Once, the people, elves, dwarves, and other inhabitants of Middle-earth gathered to reclaim the treasures stolen from them
阅读全文
摘要:E. Space Harbour There are $n$ points numbered $1$ to $n$ on a straight line. Initially, there are $m$ harbours. The $i$-th harbour is at point $X_i$
阅读全文
摘要:E. Klever Permutation You are given two integers $n$ and $k$ ($k \le n$), where $k$ is even. A permutation of length $n$ is an array consisting of $n$
阅读全文
摘要:G. Paint Charges A horizontal grid strip of $n$ cells is given. In the $i$-th cell, there is a paint charge of size $a_i$. This charge can be: either
阅读全文
摘要:Tokitsukaze and Min-Max XOR 题目描述 Tokitsukaze 有一个长度为 $n$ 的序列 $a_1,a_2,\ldots,a_n$ 和一个整数 $k$。 她想知道有多少种序列 $b_1,b_2,\ldots,b_m$,满足: $1 \leq b_i \leq n$
阅读全文
摘要:Tokitsukaze and Slash Draw 题目描述 在游戏王中有一张魔法卡叫做「一击必杀!居合抽卡」。 简单来说,当你发动这张卡后,你会从卡组最上方抽取一张卡,如果那张卡是「一击必杀!居合抽卡」的情况下,有大概率''一击必杀''打败对手。通常这张卡被玩家们称作''拔刀''。 在游戏王中,
阅读全文
摘要:F - Product Equality Problem Statement You are given $N$ integers $A_1, A_2, \dots, A_N$.Find the number of triples of integers $(i, j, k)$ that satis
阅读全文
摘要:G - Smaller Sum Problem Statement You are given a sequence $A=(A_1,A_2,\dots,A_N)$ of length $N$. Answer the following $Q$ queries. The $i$-th query i
阅读全文
摘要:[SDOI2009] HH的项链 题目描述 HH 有一串由各种漂亮的贝壳组成的项链。HH 相信不同的贝壳会带来好运,所以每次散步完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH 不断地收集新的贝壳,因此,他的项链变得越来越长。 有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同的贝
阅读全文
摘要:C. Did We Get Everything Covered? You are given two integers $n$ and $k$ along with a string $s$. Your task is to check whether all possible strings o
阅读全文
摘要:D. Good Trip There are $n$ children in a class, $m$ pairs among them are friends. The $i$-th pair who are friends have a friendship value of $f_i$. Th
阅读全文
摘要:E - Revenge of "The Salary of AtCoder Inc." Problem Statement Aoki, an employee at AtCoder Inc., has his salary for this month determined by an intege
阅读全文