Problem

Problem Source: NowCoder Online Test

Given an array $nums$ indexing from $0$ and a non-negative integer $k$.

In one operation, you can perform the following:

  • Choose an index $i$ not chosen before, where $i$ is in the range $[0, nums.length - 1]$.
  • Replace $nums[i]$ with any integer in the range $[nums[i] - k, nums[i] + k]$ (inclusive).

After applying any times of operations, return the maximum possible score of the array $nums$.

The array’s score is defined as the “maximum number of repeated elements in the array”.

Note that you can only apply the operation once for each index.

Read more »

序言

最近准备重装笔记本的系统,因此要备份文件,存到台式机里。我将要备份的文件夹压缩,通过 Windows 自带的文件夹共享(局域网共享),传输这些压缩包。

但是,传输过程却非常艰难。有的压缩包有 10 几个 GB,传了一分钟,网速就没了,之后就开始报超时之类的错误。更离谱的是,有个压缩包在两台电脑上摘要算法的结果不同。

显然,windows SMB 协议既不能保证速度,也不能保证数据正确性,于是我开始寻找更加好用的局域网传输软件。它,就是本文的主角 —— LocalSend

Read more »

Preface

With the widespread adoption of Markdown, the efficiency of using traditional text editors for writing appears to be low, especially when dealing with some complex syntax, such as inserting tables or images.

Typora, a well-known Markdown editor, not only features “live rendering” but also offers many convenient functions for writing Markdown. One notable feature is the automatic saving when inserting images: paste an image into a Markdown file (text file), and the image will be automatically saved to a specified path, with the reference automatically created in Markdown.

For someone like me who frequently takes Markdown notes, this feature should be a standard in the industry. However, another commonly used editor, VS Code, does not provide good support for this feature. Of course, we shouldn’t expect such a free, universal editor to cover every aspect.

Demands

For users who frequently take notes, capturing screenshots and inserting them into Markdown is a common practice. Two aspects affect the user experience in this operation: 1️⃣ screenshot tool 2️⃣ Markdown editor.

With a consistent screenshot tool, the Markdown editor is the key factor in determining the user experience. Below, I will elaborate on how three editors handle image insertion.

Read more »

序言

Nvidia VSR (Video Super Resolution) 通过 AI 技术优化视频的画面质量,主要表现在锐化低分辨率的视频上。该技术最初只支持 Chrome 和 Edge 浏览器。

如何在本地视频播放器中体验这项技术?PotPlayer 最近发布了相关更新,支持了该技术。

PotPlayer 是目前数一数二的视频播放器,也是我的主力播放器。趁着这次更新,我来记录一下如何在 PotPlayer 上使用 Nvidia Super Resolution.

浏览器开启 VSR

本小节先介绍一下如何让 Chrome 和 Edge 浏览器使用 Nvidia Super Resolution。

Read more »
0%