07 2021 档案
摘要:题目 题目描述 题目链接 Lena is the most economicalgirl in Moscow. So, when her dad asks her to buy some food for a trip to the country, she goes to the best sto
阅读全文
posted @ 2021-07-31 17:12
lipu123
摘要:You are given an integer n. Find any string ss of length n consisting only of English lowercase letters such that each non-empty substring of s occurs
阅读全文
摘要:题目: 题目链接 You are given two integers nn and mm. Find the MEXMEX of the sequence n⊕0,n⊕1,…,n⊕mn⊕0,n⊕1,…,n⊕m. Here, ⊕ is the bitwise XOR operator. MEX of
阅读全文
摘要:题目: 是一个简单的小问题。他写写画画,画出了一个n×m的矩阵,每个格子里都有一个不超过k的正整数。小F想问问你,这个矩阵里有多少个不同的子矩形中的数字之和是k的倍数?如果把一个子矩形用它的左上角和右下角描述为(x1,y1,x2,y2),其中x1≤x2,y1≤y2;那么,我们认为两个子矩形是不同的,
阅读全文
摘要:题目 题目链接 题目描述 有 n 个人排成一个队列,从左到右 编号为 0 到 n - 1 。给你以一个整数数组 heights ,每个整数 互不相同,heights[i] 表示第 i 个人的高度。 一个人能 看到 他右边另一个人的条件是这两人之间的所有人都比他们两人 矮 。更正式的,第 i 个人能看
阅读全文
摘要:题目: Problem Description You are given an array fx.For each i(1<=i<=n) , we use a point (i,fx[i]) in XoY coordinate plane to described it.You are asked
阅读全文
摘要:题目 题目描述 在一次运会上,有一个比赛项目,共有N个人参加比赛,要将这N个人分组,每组人数不少于K个,问有多少种分组方式?比如有16个运动员,每组人数不少于5个,共有6种分组方式:(1) 分一组,为16人;(2) 分二组,分别为11人、5人;(3) 分二组,分别为10人、6人;(4) 分二组,分别
阅读全文
摘要:This problem is an extension of the problem "Wonderful Coloring - 1". It has quite many differences, so you should read this statement completely. Rec
阅读全文
摘要:题目: 传送门: Consider a sequence of integers a1,a2,…,an In one move, you can select any element of the sequence and delete it. After an element is deleted
阅读全文
摘要:题目: 题目链接: Description Input The first line contains an integer T . Then T test cases follow. Each test case contains three lines. The first one contai
阅读全文
摘要:题目: I love exam HDU - 6968 Student Z doesn't love exams The exam was about to be done soon, but student Z didn't even read the book, He had collapsed.
阅读全文
摘要:题目链接 我们有一棵有根的树,有 N 个顶点,编号为 1,2,...,N。顶点 1 是根,顶点 i(2≤i≤N) 的父节点是顶点 Pi。您将收到 Q 查询。在第 i 个查询 (1≤i≤Q) 中,给定整数 Ui 和 Di,找到满足以下所有条件的顶点 u 的数量:顶点 Ui 在从 u 到根(包括端点)的
阅读全文
摘要:Among the strings of length A+B containing A occurrences of a and B occurrences of b, find the string that comes K-th in the lexicographical order.Con
阅读全文
摘要:Given a matrix of n rows and m columns,find the largest area submatrix which is non decreasing on each column Input The first line contains an integer
阅读全文
摘要:题目: 传送门 Description Given a sequence of integers of length nn, find the shortest consecutive subsequence witch XOR sum not less than kk. If there are
阅读全文
摘要:The land of a park AtCoder is an N×N grid with east-west rows and north-south columns. The height of the square at the i-th row from the north and j-t
阅读全文
摘要:在遥远的公元前65536世纪,β星座的焃碁星人发现了地球,他们对于该星球上碳基生物的大脑构造感到非常的好奇, 在植入了夸克级别的神经元控制器后, 他们夺取了所有生物大脑内惊人的算力,进而控制了所有的生物。几亿年以后, 人类凭借着自己贫瘠的算力, 造出了庞大而惊人的超大规模集成电路,他们训练的Alph
阅读全文
摘要:1937. 扣分后的最大得分 给你一个 m x n 的整数矩阵 points (下标从 0 开始)。一开始你的得分为 0 ,你想最大化从矩阵中得到的分数。 你的得分方式为:每一行 中选取一个格子,选中坐标为 (r, c) 的格子会给你的总得分 增加 points[r][c] 。 然而,相邻行之间被选
阅读全文
摘要:1931. 用三种不同颜色为网格涂色 给你两个整数 m 和 n 。构造一个 m x n 的网格,其中每个单元格最开始是白色。请你用 红、绿、蓝 三种颜色为每个单元格涂色。所有单元格都需要被涂色。 涂色方案需要满足:不存在相邻两个单元格颜色相同的情况 。返回网格涂色的方法数。因为答案可能非常大, 返回
阅读全文
摘要:You have a maze with obstacles and non-zero digits in it: You can start from any square, walk in the maze, and finally stop at some square. Each step,
阅读全文
摘要:例一: 一个国家有 n 个城市,城市编号为 0 到 n - 1 ,题目保证 所有城市 都由双向道路 连接在一起 。道路由二维整数数组 edges 表示,其中 edges[i] = [xi, yi, timei] 表示城市 xi 和 yi 之间有一条双向道路,耗费时间为 timei 分钟。两个城市之间
阅读全文
摘要:平面上遍布着 n 座城市,编号 1∼n。 第 ii 座城市的位置坐标为 (xi,yi)。 不同城市的位置有可能重合。 现在要通过建立发电站和搭建电线的方式给每座城市都通电。 一个城市如果建有发电站,或者通过电线直接或间接的与建有发电站的城市保持连通,则该城市通电。 在城市 i 建立发电站的花费为 c
阅读全文
摘要:遇到这种问题一定要变形式子 传送门: 给定 n 个石子,编号为 1∼n。 其中第 i 个石子的价值为 ai。 你需要从中任意挑选若干个石子,并将挑选好的石子按照编号从小到大的顺序排成一排。 选中的石子在排好序后需要满足,对于任意两个相邻的石子(不妨设它们的编号为 x,y,x−y=ax−ay 均成立。
阅读全文
摘要:给定一个长度为 nn 的数组 v1,v2,…,vn 初始时,数组中的所有元素都为 0。 接下来,可以对该数组进行若干次如下操作 对于第 i 次操作(i 从 0 开始),你可以: 要么选择其中一个元素 v[pos],将其增加 k^i。 要么不选择任何元素,直接跳过此次操作。 你可以随时停止操作(不进行
阅读全文
摘要:希腊有一个著名的历史学家,他为了专心写一本史学巨著,而把自己关在一个高塔之上。有一天,他目睹了一场凶杀案的发生,但事后,他惊讶地发现所有围观人的证词都不一样,甚至有的完全相反。于是,他放弃了继续写作的念头。他说:“人们连发生在眼前的事实都分辨不清,我又怎么知道我写的历史是真是假呢?” 虽然历史的真假
阅读全文