CodeForces 2145/D
Created|Updated|Coding PracticeCF
|Post Views:
Author: Puxuan
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2025-10-07
CF 刷题记录
记录自己在 CodeForce 上的刷题节奏、思路沉淀与反思,方便复盘和查缺补漏。 刷题目标 每周至少完成 5 道不同类型的题目,关注题型覆盖面而非刷题数量 优先补齐弱项(图论、动态规划、数据结构设计等) 输出简洁题解与时间 / 空间复杂度分析 2025 Week 1 题目 难度 题型 思路小结 复盘 链接 Gravity Falls 1800 贪心 + 排序 通过贪心策略,排序后选择最优解 ✅ 完成 https://codeforces.com/problemset/problem/2148/F 模板:题目记录123456### 题目:<题目名>- 难度:- 标签:- 提交日期:- 题解:核心思路 + 复杂度分析- Review:未来需要注意的坑 or 可优化点 总结 每周回顾时,记录这一周遇到的典型问题与收获 标注卡壳较久的题目,单独开小抄或强化练习
2025-10-08
CodeForces 2148/F
Gravity Falls[] 题目描述F. Gravity Falls time limit per test2 secondsmemory limit per test256 megabytes Farmer John has narrays a1,a2,…,an that may have different lengths. He will stack the arrays on top of each other, resulting in a grid with n rows. The arrays are left-aligned and can be stacked in any order he desires. Then, gravity will take place. Any cell that is not on the bottom row and does not have an element beneath it will fall down a row. This process will be repeated until there are...
2025-10-08
CodeForces 2145/C
Monocarp’s String
2025-10-25
CF 2156 C
C. Maximum GCD on Whiteboard题目描述
2025-10-08
LeetCode 629 - K Inverse Pairs Array
题目描述[HARD] For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j]. Given two integers n and k, return the number of different arrays consisting of numbers from 1 to n such that there are exactly k inverse pairs. Since the answer can be huge, return it modulo 10^9 + 7. Example 1: 123Input: n = 3, k = 0Output: 1Explanation: Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pai...
2025-10-10
LeetCode 34 - First and Last Position of Element in Sorted Array
题目描述(Medium) Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. Example 1: 12Input: nums = [5,7,7,8,8,10], target = 8Output: [3,4] Example 2: 12Input: nums = [5,7,7,8,8,10], target = 6Output: [-1,-1] Example 3: 12Input: nums = [], target = 0Output: [-1,-1] 思路1 二分查找代码1234567891011121314151617181920212223...
Announcement
This is my Blog