increasing decreasing 1864a and

[CF1819D] Misha and Apples

Misha and Apples 只能做做评分虚高的题了,头痛浪费了一节晚自习。 但是为什么机房的同学们都觉得2500~2800算水题呢? 最终的答案一定是 \([S_1,S_x]\) 被清空,\([S_{x+1},S_n]\) 被全部放入集合。 若 \(\exists i\in[x+1,n],k_ ......
Apples 1819D Misha 1819 and

ST: USB Host and Device

ST: USB Host and Device USB Devices实现 可实现用一个USB接口实现多个USB设备,如 HID+MSC; HID+CDC; HID+CDC+MSC等等 使用HAL库及USB库,以HID+MSC为例 一、增加端点 增加端点,同时修改FIFO配置大小,STM32 USB ......
Device Host USB and ST

CF1677D Tokitsukaze and Permutations

好玩题。 对于一个排列 \(p\),进行 \(k\) 轮冒泡,记 \(v_i = \sum_{j < i} [p_j < p_i]\),给定 \(v_i\),部分值不确定,求合法的 \(p\) 的个数。 \(p\) 由 \(v\) 唯一确定。 考虑一个个加数字进去,每次可以判断加入数字与前面数字的相 ......
Permutations Tokitsukaze 1677D 1677 and

Day_and_Night

Day_and_Night 题目源码 from Crypto.Util.number import * def pad(msg): # PKCS#1 v1.5 print(f'{2048 // 8 - len(msg) = }') # 189个字节附近, 也就是约等于 189 * 8 = 1512 ......
Day_and_Night Night Day and

CF 1867 E1. Salyg1n and Array (simple version)

Link 简单版本的结论还是很容易猜到的。 首先很容易想到的第一步就是尽可能地不覆盖地取尽可能多地区间,最后剩下了一小块。 然后在接着原来的指针一个一个地往右问,直到不能问了为止。 为什么这样是正确的呢?首先,在这样一步一步地往右查询的过程中,我们会发现总是前$k-1个数加上后面的一个数。 然后题面 ......
Salyg1n version Salyg1 simple Array

Alice and Hairdresser题解

Alice and Hairdresser 第一眼线段树,第二眼好像可以直接用数组模拟。 当一根头发长于 $l$,它再长多长其实都一样,所以不用开 long long。 如果一根新的头发长到比 $l$ 长,那可以分成以下几种情况: 如果它左侧和右侧只有一个元素大于 $l$ ,那答案不变。 如果左侧和 ......
题解 Hairdresser Alice and

About Cnblog : Faith and Salvation

博客园(Cnblogs)是一个中国的技术博客平台,致力于为技术爱好者、开发者和IT专业人员提供一个分享知识和经验的社区 我不对其它类似平台做评价,平台与用户行为以及水平并不挂钩. 关于Salvation的建议:由于cnblog的初始UI以及性能感官较差,建议对网站进行风格优化,吸引新成员.对网站自定 ......
Salvation Cnblog About Faith and

论文解读(FixMatch)《FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence》

Note:[ wechat:Y466551 | 可加勿骚扰,付费咨询 ] 论文信息 论文标题:FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence论文作者:论文来源:2020 aRxiv论文地址: ......

E. Increasing Frequency 最大子段和

题意:给你一个长度为n的数组,再给你一个c,问一次操作后,你最多能让数组中存在多少个c? 操作:选择一个区间,对这个区间加上任意整数。 做法:那么我们转化一下这个一题,就是要选择一个区间,使得该区间里有一个数,他的数量减去c的数量最大。这个其实就是一个最大子段和,我们数据范围内出现过的数每个都跑一遍 ......
Increasing Frequency

CF677D Vanya and Treasure

这题纯大力搞过去的,没用到啥技巧,后面看了下别人的做法发现还是很有意思的 我的做法就很粗暴,考虑令\(f_{i,j}\)表示走到\((i,j)\)的最短路,转移的话不难发现是个分层图DP 但是有一个显然的问题是当相邻两层间的点数很多时,暴力做的话会退化成\(O(n^2\times m^2)\),因此 ......
Treasure Vanya 677D 677 and

变量and输入输出

变量and输出 概念:变量,本质上是一个装东西的盒子,而且只能装一个值 一、 1.变量的命名规则 变量的名字由字母,数字,下划线_组成,不能以数字开头,不能以关键字命名,且区分大小写 变量的定义 格式:变量名 = 值 = 赋值符号 ==等于 a=1 b=2.1 c='hhh' 3.变量的类型 str ......
变量 and

Deltix Round, Autumn 2021 (open for everyone, rated, Div. 1 + Div. 2) A. Divide and Multiply

有一个长为 \(n\) 的数组,可以执行以下整份操作任意次: 选择任意两个数 \(a_i, a_j\) ,满足 \(2 \mid a_i\) \(a_i = \frac{a_i}{2}\) \(a_j = 2 \cdot a_j\) 请找到经过任意此操作后的最大 \(\sum_{i=1}^{n} a ......
Div Multiply everyone Deltix Autumn

CF453C Little Pony and Summer Sun Celebration

如果一个点需要经过奇数次我们称其为奇点,偶数次则称其为偶点。 考虑不合法的情况,有任意两个奇点不连通,因为不经过也是经过偶数次。 那么需要处理的部分就是包含奇点的唯一一个连通块。先随意撸出一棵生成树,然后正常地 DFS 下去。显然有些结点可能不符合要求的奇偶性,对于父亲结点 \(u\) 和儿子结点 ......
Celebration Little Summer 453C Pony

论文阅读: Co-design Hardware and Algorithm for Vector Search

1. Introduction 介绍一下论文背景, 向量检索常用于 搜索引擎,推荐系统,LLM和科学计算等 对应的常用的硬件向量检索方法,IVF-PQ 其中IVF:将多个向量聚类, PQ将向量压缩 而为了最大化IVF-PQ的效果,也会面临很多的挑战 在芯片设计的过程中,会遇到针对六个阶段如何设计合适 ......
Co-design Algorithm Hardware design Vector

Replacing gcc and g++ with GNU version in macOS

After we install Xcode Command Line Tools, we will get gcc and g++ in /Library/Developer/CommandLineTools/usr/bin and the same contents in /usr/bin. B ......
Replacing version macOS with GNU

CF1858D Trees and Segments

原题 翻译 这题预期说是\(dp\),不如说是预处理吧233 首先我们同时考虑两维限制是很困难的,如果我们想直接\(dp\)要设很多状态,复杂度爆炸 因此我们考虑暴力枚举一维。具体的,我们枚举把\([l,r]\)内的所有数染成\(0\),我们可以通过前缀和得到操作次数\(t\)(即为区间内\(1\) ......
Segments 1858D Trees 1858 and

[ARC122E] Increasing LCMs

[ARC122E] Increasing LCMs Atcoder:[ARC122E] Increasing LCMs 洛谷:[ARC122E] Increasing LCMs Solution 应该意识到这题的核心思想在于构造,想办法将原问题不断划分为子问题。 此题策略的证明不算太难,但以我目前的 ......
Increasing 122E LCMs ARC 122

Fox and Minimal path 题解

Fox and Minimal path 题目大意 构造一张无向图,使得从 \(1\) 到 \(2\) 的最短路数量为 \(k\)。 思路分析 我们首先可以发现当 \(k = 2^t\) 时的构造方式: 其中只有 \(O(\log k)\) 个点。 当 \(k\not = 2^t\) 时,我们可以将 ......
题解 Minimal path Fox and

How to parse OR AND within text

假设你有一行 String condition = "A or B and C"; 语句,请问怎么做才能变成一行真正的逻辑表达式(能在计算机中运行计算)? Resolution 声明一个List<List<String>>结构; 先分割 or ; 变成 [ A, B and C ] 不包含and的, ......
within parse text How AND

doris建表报错 errCode = 2, detailMessage = Scale of decimal must between 0 and 9. Scale was set to: 10

doris建表报错 问题背景 当我从Mpp库向doris库中导数据时,需要先创建对应的数据表,将Mpp库中表的建表语句略作修改后,在doris服务器上运行 CREATE TABLE opt_connect_box_v8 ( CNT_BOX_ID char(72) NOT NULL, CNT_BOX_ ......
表报 Scale detailMessage decimal between

Cisco Nexus 9000 系列交换机系统软件 NX-OS Standalone 10.4(1)F and ACI Mode 16.0(3e) 发布

Cisco Nexus 9000 系列交换机系统软件 NX-OS Standalone 10.4(1)F and ACI Mode 16.0(3e) 发布 Cisco Nexus 9000 Series Switches, NX-OS Standalone 10.4(1)F and ACI Mode ......
交换机 Standalone 系统 Cisco Nexus

F. Mahmoud and Ehab and yet another xor task 线性基

Problem - F - Codeforces 题意:给出一个长度为n的数组,然后给出q次询问。 对于每次询问,给出一个l和一个x,请你求出在[1,l]这个区间内,有多少个子序列是好的,好的的定义是这个子序列的异或和为x。 做法:考虑线性基,先离线处理询问,对其l排序。然后对于l,求该情况下的线性 ......
线性 and Mahmoud another Ehab

哈希表 知识速记(9/11 and 9/13)

哈希表 拉链法 #include <cstring> #include<string> #include <iostream> using namespace std; const int N = 100003; int h[N], e[N], ne[N], idx; void insert(int ......
知识 and 11 13

error Mixed spaces and tabs no-mixed-spaces-and-tabs

运行Vue项目出现下面截图中的这个问题 百度翻译一下,说是不能同时使用tab键和空格来对代码进行缩进。看了一下代码,确实有行代码缩进了6个字符,改回来正常运行。 ......

Codeforces Round 787 (Div. 3) B. Make It Increasing

给一个长为 \(n\) 的数组 \(a_1, a_2, \cdots, a_n \quad (0 \leq a_i \leq 10^9)\) 。可以执行以下操作任意次: 选择任意一个 \(a_i\) 并且执行 \(a_i = \lfloor \frac{a_i}{2} \rfloor\) 。 输出最 ......
Codeforces Increasing Round Make 787

Transformer-empowered Multi-scale Contextual Matching and Aggregation for

Transformer-empowered Multi-scale Contextual Matching and Aggregation for Multi-contrast MRI Super-resolution(阅读文献)10.12 基于变压器的磁共振多对比度超分辨率多尺度背景匹配与聚合 摘 ......

2023.9.13 greedy and DS

CF1439C 考虑修改操作,由于序列是单调的,所以只需要线段树二分出修改的区间即可。 考虑查询,一定是若干个连续段,设一开始是 \(y\),这个连续段结束后,\(y\) 至少减去一半,所以连续段个数是 \(\log\) 级别。 在线段树上遍历即可。 ......
greedy 2023 and 13 DS

frequently used character, numeric, and date functions

# Character functions ## ANYALNUM(str, startpos) Return position of first occurrence of any alphabetic or numeric value after or at the start postion ......
frequently character functions numeric date

SQLAlchemy: What's the difference between flush() and commit()?

SQLAlchemy: What's the difference between flush() and commit()? https://pyquestions.com/sqlalchemy-what-s-the-difference-between-flush-and-commit A Se ......
SQLAlchemy difference between commit flush

Failed to connect to server: hadoop/ip:9000: try once and fail.

hadoop 连接失败,报如下错误! java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChann ......
connect Failed server hadoop 9000