01 2023 档案

摘要:C. Remove the Bracket RSJ has a sequence a of n integers a1,a2,,an and an integer s. For each of a2,a3,,an1, he cho 阅读全文
posted @ 2023-01-31 16:31 onlyblues 阅读(71) 评论(0) 推荐(0) 编辑
摘要:F. Timofey and Black-White Tree Timofey came to a famous summer school and found a tree on n vertices. A tree is a connected undirected graph withou 阅读全文
posted @ 2023-01-30 19:01 onlyblues 阅读(117) 评论(0) 推荐(0) 编辑
摘要:斐波那契前 n 项和 大家都知道 Fibonacci 数列吧,f1=1,f2=1,f3=2,f4=3,,fn=fn1+fn2。 现在问题很简单,输入 nm,求 fn 的前 n 项和 Snmodm。 输入格式 共一行, 阅读全文
posted @ 2023-01-28 17:04 onlyblues 阅读(133) 评论(0) 推荐(0) 编辑
摘要:最幸运的数字 8 是中国的幸运数字,如果一个数字的每一位都由 8 构成则该数字被称作是幸运数字。 现在给定一个正整数 L,请问至少多少个 8 连在一起组成的正整数(即最小幸运数字)是 L 的倍数。 输入格式 输入包含多组测试用例。 每组测试用例占一行,包含一个整数 L。 当输 阅读全文
posted @ 2023-01-28 11:45 onlyblues 阅读(96) 评论(0) 推荐(0) 编辑
摘要:B. GCD Partition While at Kira's house, Josuke saw a piece of paper on the table with a task written on it. The task sounded as follows. There is an a 阅读全文
posted @ 2023-01-27 17:16 onlyblues 阅读(61) 评论(0) 推荐(0) 编辑
摘要:D. Fixed Prefix Permutations You are given n permutations a1,a2,,an, each of length m. Recall that a permutation of length m is a s 阅读全文
posted @ 2023-01-27 16:23 onlyblues 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Rank Transform of a Matrix Given an m x n matrix , return a new matrix answer where answer[row][col] is the rank of matrix[row][col] . The rank is an 阅读全文
posted @ 2023-01-25 16:47 onlyblues 阅读(29) 评论(0) 推荐(0) 编辑
摘要:Minimum Cost to Split an Array You are given an integer array nums and an integer k. Split the array into some number of non-empty subarrays. The co 阅读全文
posted @ 2023-01-22 12:51 onlyblues 阅读(29) 评论(0) 推荐(0) 编辑
摘要:B. Emordnilap A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, $[2,3,1,5,4 阅读全文
posted @ 2023-01-22 10:13 onlyblues 阅读(47) 评论(0) 推荐(0) 编辑
摘要:C. Quiz Master A school has to decide on its team for an international quiz. There are n students in the school. We can describe the students using 阅读全文
posted @ 2023-01-22 09:40 onlyblues 阅读(277) 评论(0) 推荐(0) 编辑
摘要:最大公约数 给定整数 N,求 1x,yNGCD(x,y) 为素数的数对 (x,y) 有多少对。 GCD(x,y) 即求 xy 的最大公约数。 输入格式 输入一个整数 N。 输出格式 输出一个整数,表示满足条件 阅读全文
posted @ 2023-01-21 18:54 onlyblues 阅读(26) 评论(0) 推荐(0) 编辑
摘要:可见的点 在一个平面直角坐标系的第一象限内,如果一个点 (x,y) 与原点 (0,0) 的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点 (4,2) 就是不可见的,因为它与原点的连线会通过点 (2,1)。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数 阅读全文
posted @ 2023-01-21 18:17 onlyblues 阅读(66) 评论(0) 推荐(0) 编辑
摘要:Hankson的趣味题 Hanks 博士是 BT(Bio-Tech,生物技术)领域的知名专家,他的儿子名叫 Hankson。 现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数 c1c2 的最大公约数和最小公倍数。 现在 Han 阅读全文
posted @ 2023-01-21 12:57 onlyblues 阅读(150) 评论(0) 推荐(0) 编辑
摘要:樱花 给定一个整数 n,求有多少正整数数对 (x,y) 满足 1x+1y=1n!。 输入格式 一个整数 n。 输出格式 一个整数,表示满足条件的数对数量。 答案对 109+7 取模。 数据范围 $ 1 \leq n \l 阅读全文
posted @ 2023-01-21 09:43 onlyblues 阅读(145) 评论(0) 推荐(0) 编辑
摘要:质数距离 给定两个整数 LU,你需要在闭区间 [L,U] 内找到距离最接近的两个相邻质数 C1C2(即 C2C1 是最小的),如果存在相同距离的其他相邻质数对,则输出第一对。 同时,你还需要找到距离最远的两个相邻质数 D1D2(即 $D 阅读全文
posted @ 2023-01-20 13:42 onlyblues 阅读(184) 评论(0) 推荐(0) 编辑
摘要:D. Many Perfect Squares You are given a set a1,a2,,an of distinct positive integers. We define the squareness of an integer x as the n 阅读全文
posted @ 2023-01-19 16:20 onlyblues 阅读(121) 评论(0) 推荐(0) 编辑
摘要:C. Equal Frequencies Let's call a string balanced if all characters that are present in it appear the same number of times. For example, "coder", "app 阅读全文
posted @ 2023-01-18 23:12 onlyblues 阅读(323) 评论(0) 推荐(1) 编辑
摘要:Difference Between Maximum and Minimum Price Sum There exists an undirected and initially unrooted tree with n nodes indexed from 0 to n1. Yo 阅读全文
posted @ 2023-01-18 12:15 onlyblues 阅读(42) 评论(0) 推荐(0) 编辑
摘要:D. Friendly Spiders Mars is home to an unusual species of spiders — Binary spiders. Right now, Martian scientists are observing a colony of n spider 阅读全文
posted @ 2023-01-17 18:14 onlyblues 阅读(118) 评论(0) 推荐(0) 编辑
摘要:C. Interesting Sequence Petya and his friend, robot Petya++, like to solve exciting math problems. One day Petya++ came up with the numbers n and $x 阅读全文
posted @ 2023-01-17 11:41 onlyblues 阅读(63) 评论(0) 推荐(0) 编辑
摘要:最大价值 已知,小写字母 az 的价值分别为 wa,wb,,wz。 对于一个由小写字母构成的长度为 l 的字符串 S=s1s2sl,其价值为 $w_{s1} \times 1 + w_{s2} \times 2 + 阅读全文
posted @ 2023-01-16 17:17 onlyblues 阅读(39) 评论(0) 推荐(0) 编辑
摘要:B. Gardener and the Array The gardener Kazimir Kazimirovich has an array of n integers c1,c2,,cn. He wants to check if there are two di 阅读全文
posted @ 2023-01-15 18:24 onlyblues 阅读(95) 评论(5) 推荐(0) 编辑
摘要:等差数列 给定一个长度为 n 的正整数数列 a1,a2,,an 和一个正整数 k。 你可以对数列进行以下两种操作: + i x ,增加操作,将 ai 的值增加 xx1)。- i x ,减少操作,将 ai 的值减少 x($x \g 阅读全文
posted @ 2023-01-13 23:13 onlyblues 阅读(165) 评论(0) 推荐(0) 编辑
摘要:Maximize the Minimum Powered City You are given a 0-indexed integer array stations of length n, where stations[i] represents the number of power sta 阅读全文
posted @ 2023-01-13 16:05 onlyblues 阅读(25) 评论(0) 推荐(0) 编辑
摘要:Number of Great Partitions You are given an array nums consisting of positive integers and an integer k . Partition the array into two ordered groups  阅读全文
posted @ 2023-01-12 23:18 onlyblues 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Count Pairs With XOR in a Range Given a (0-indexed) integer array nums and two integers low and high , return the number of nice pairs. A nice pair is 阅读全文
posted @ 2023-01-12 16:45 onlyblues 阅读(39) 评论(0) 推荐(0) 编辑
摘要:Maximum Number of Points From Grid Queries You are given an m×n integer matrix grid and an array queries of size k. Find an array answer of 阅读全文
posted @ 2023-01-11 17:24 onlyblues 阅读(28) 评论(0) 推荐(0) 编辑
摘要:Frog Jump II You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river. A fro 阅读全文
posted @ 2023-01-11 10:15 onlyblues 阅读(39) 评论(0) 推荐(0) 编辑
摘要:技能升级 小蓝最近正在玩一款 RPG 游戏。 他的角色一共有 N 个可以加攻击力的技能。 其中第 i 个技能首次升级可以提升 Ai 点攻击力,以后每次升级增加的点数都会减少 BiAiBi(上取整) 阅读全文
posted @ 2023-01-10 17:07 onlyblues 阅读(65) 评论(0) 推荐(0) 编辑
摘要:选数异或 给定一个长度为 n 的数列 A1,A2,,An 和一个非负整数 x,给定 m 次查询,每次询问能否从某个区间 [l,r] 中选择两个下标不同的数使得他们的异或等于 x。 输入格式 输入的第一行包含三个整数 n,m,x。 第二行包含 n 个整 阅读全文
posted @ 2023-01-09 11:54 onlyblues 阅读(100) 评论(0) 推荐(0) 编辑
摘要:上课睡觉 有 N 堆石子,每堆的石子数量分别为 a1,a2,,aN。 你可以对石子堆进行合并操作,将两个相邻的石子堆合并为一个石子堆,例如,如果 a=[1,2,3,4,5],合并第 2,3 堆石子,则石子堆集合变为 a=[1,5,4,5]。 我们希望通过尽可 阅读全文
posted @ 2023-01-05 19:11 onlyblues 阅读(45) 评论(0) 推荐(0) 编辑

Web Analytics
点击右上角即可分享
微信分享提示