随笔分类 - 算法-刷题题目 / codeforces
摘要:https://leetcode.cn/problems/count-beautiful-splits-in-an-array/description/ 给你一个整数数组。 如果数组的一个分割满足以下条件,我们称它是一个 美丽 分割: 数组分为三段非空
阅读全文
摘要:https://leetcode.cn/problems/minimum-length-of-anagram-concatenation/description/ 给你一个字符串,它由某个字符串和若干的 同位字符串 连接而成。 请你返回字符串的 最小 可能长度
阅读全文
摘要:https://leetcode.cn/problems/sum-of-digit-differences-of-all-pairs/description/ 所有数对中数位不同之和 车尔尼有一个数组 nums ,它只包含 正 整数,所有正整数的数位长度都 相同 。 两个整数的 数位不同 指的是两个
阅读全文
摘要:https://blog.csdn.net/m0_73896521/article/details/135308235 Problem Statement You are given a sequence of length. Respond t
阅读全文
摘要:https://atcoder.jp/contests/abc330/tasks/abc330_d Problem Statement You are given angrid. Letdenote the cell in the i-th row fr
阅读全文
摘要:题目描述 传送门 题目大意:给出一个长度为 n 的数组 a 和计算贡献的数组 sum,需要执行 m 次操作,每次操作分为下列两种类型: 1 l r x:将区间 [ l , r ] 内的 a 用 x 覆盖,即 i ∈[ l , r] , a[ i ] = x,且 sum[ i ] += abs( a[
阅读全文
摘要:例一: 传送门 题意: 就是给你个物品,每一个物品都有一个体积,然后给你个箱子,问你这个箱子的最小的体积是多少才能将这些物品都放到这m个箱子里 n,m(1≤n,m≤1000),v1,v2…,vn ( 1≤v1,v2,…,vn≤1000) 1 5 3 1 2 3 4 5 Cas
阅读全文
摘要:题目 题目描述 题目链接 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
阅读全文
摘要:题目: 题目链接 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
阅读全文
摘要: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
阅读全文
摘要:遇到这种问题一定要变形式子 传送门: 给定 n 个石子,编号为 1∼n。 其中第 i 个石子的价值为 ai。 你需要从中任意挑选若干个石子,并将挑选好的石子按照编号从小到大的顺序排成一排。 选中的石子在排好序后需要满足,对于任意两个相邻的石子(不妨设它们的编号为 x,y,x−y=ax−ay 均成立。
阅读全文
摘要:题目连接 题目讲解 给定一个初始长度为 n 的数组 a 以及一个整数 x。 我们现在要对数组 a 进行延伸,具体方法如下: 我们从数组中的第一个元素开始,逐个遍历数组中的每个元素。 当遍历到数组中的元素 q 时,如果 q 能够被 x 整除,则在数组的末尾添加 x 个整数 q/x,并开始遍历下一个元素
阅读全文
摘要:传送门 Dima overslept the alarm clock, which was supposed to raise him to school. Dima wonders if he will have time to come to the first lesson. To do th
阅读全文
摘要:You are given an undirected graph consisting of nn vertices and mm edges. Your task is to find the number of connected components which are cycles. He
阅读全文
摘要:泰泰学长喜欢玩数字(不知道什么奇怪的癖好)。他在黑板上写下一个数字 x ,然后进行 n-1 次以下两种操作: x 除以3 (必须能整除才能进行,即 x mod 3=0) x 乘以2 每次操作完成后,泰泰学长在黑板上写上这个操作后的新数字,并让这个新数字作为新的 x 继续下一次操作。最后黑板上有 n
阅读全文
摘要:网址:http://codeforces.com/problemset/problem/1287/A It's a walking tour day in SIS.Winter, so tt groups of students are visiting Torzhok. Streets of To
阅读全文
摘要:小T自幼学习中国象棋,小学时曾荣获龙城小学象棋比赛冠军,他对中国象棋情有独 钟,外出参加信息学夏令营等活动时都要随身携带一副中国象棋,一有空就会摆开棋跟小 伙伴们杀上几盘。自从在小学编程班上听了国际象棋的起源传说后,小T又对神秘的国际 象棋产生了浓厚兴趣,由于学习任务繁重并且课余时间还要用来编写程序
阅读全文