ergodicity liouville theorem and

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

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个字符,改回来正常运行。 ......

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

Concurrency and Parallelism

简而言之,Concurrency(并发)就是交替执行多个任务,而 Parallelism(并行)是同时执行多个任务。 Concurrency Parallelism 多线程和硬件 在单核CPU中,只有并发,没有并行; 编程中,编程语言调用系统的接口,编程语言只负责调用,至于是并发还是并行,还得取决于 ......
Concurrency Parallelism and

CF1867A green_gold_dog, array and permutation

思路 很简单的一道题,洛谷大概都不会开放题解通道?(实际上貌似每场比赛的 A 都没开放?) 显然,对于原数组较小的数,我们尽量让大的数,取全排列的较小的数,这样可以保证差是逐渐变小的,也就让 \(c\) 数组差异变大。 所以直接拿个 struct 存,然后两边排序就好。 AC code #inclu ......
green_gold_dog permutation 1867A green array

CF1867C Salyg1n and the MEX Game

思路 看着无从下手,实际上又是一道诈骗题。 假设原数列不存在 \(0\),那么我们可以直接加入 \(0\),然后游戏结束,假设答案是 \(k\)。那么,如果我们选择加入 \(k\),来试图让答案变大,那么 Bob 就会移除一个数,最优的话是 \(1\),这样的话,你无论加入 \(1\) 还是 \(0 ......
Salyg1n Salyg1 1867C Salyg 1867

CF1867E1 Salyg1n and Array (simple version)

思路 首先考虑,\(n\) 是 \(k\) 的倍数的情况,直接枚举询问所有每一段就好,然后输出每一段的异或和的异或和。 如上图,每次询问都没有重叠部分,颠转互不干扰。 那么,\(n\) 不是 \(k\) 的倍数的情况呢? 可以看到,与第一种情况的区别就是末尾多了一小截,那么我们需要考虑如何计算这一小 ......
Salyg1n version Salyg1 simple 1867E

CF1867E2 Salyg1n and Array (hard version)

其实如果你在做 E1 的时候想到正解了,这道题都甚至不需要改 E1 的代码,直接交就好,这大概也是 E2 的分还没 E1 的高的原因。 因为一摸一样的思路,所以这里就不作介绍了,可以看看我的题解。 在这里呢,主要是稍微证明一下询问次数不会超,如下: 可以发现,有余数的情况,只会增加两次询问,而后面的 ......
Salyg1n version Salyg1 1867E Array

CF1718F Burenka, an Array and Queries

显然先考虑把每个 \(a_i\) 只因数分解,令 \(S(x)\) 表示 \(x\) 只因子的集合。 令 \(S_{l,r}=S\left(\prod\limits_{i=l}^ra_i\right)=S(a_l)\cup S(a_{l+1})\cup\cdots \cup S(a_r)\)。假如我 ......
Burenka Queries 1718F Array 1718

CF1559D1&D2 Mocha and Diana

原题(Eazy Version) 原题(Hard Version) 翻译 首先我们先考虑Eazy Version。容易发现,在\(A,B\)两个森林中一定有一个是一棵树。这个结论说明: 选边顺序没影响 能选就选 因此我们枚举\(n^2\)条边,用并查集判断连通性即可 最终复杂度\(O(n^2 \al ......
Mocha Diana 1559 amp and

Graph Construction and b-Matching for Semi-Supervised Learning

目录概符号说明图的构建Graph Sparsification\(\epsilon\)-neighborhood graph\(k\)NN graph\(b\)-MatchingGraph Edge Re-Weighting Jebara T., Wang J. and Chang S. Graph ......

Typical Models of RNN and TFF

RNN LSTM(2014) Recurrent Neural Networks Hidden State: \(h\) \(h_t = tanh(U h_{t-1} + W x_t + b)\) \(y_t = Vh_t\) h: history state tanh : active funct ......
Typical Models RNN TFF and

install mysqlcppconn library and retrieve from mysql database table

sudo apt install libmysqlcppconn-dev #include <algorithm> #include <atomic> #include <barrier> #include <bitset> #include <chrono> #include <ctime> #i ......

Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 A. Mainak and Array

给一个长为 \(n\) 的正整数数组,执行以下操作严格一次。 选择 \(l, r, (1 \leq l < r \leq n)\) ,任意一个正整数 \(k\) 。 重复 \(k\) 次:让 \([l, r]\) 的数组成环,按顺时针走一次。 希望 \(a_n - a_1\) 最大,找到这个数。 分 ......
Codeforces Div and Grimoire Contest

【CF1364C】Ehab and Prefix MEXs(构造)

题目大意: 给出长度为\(n(1\le n\le 10^5)\)的数组\(a\),构造数组\(b\)使得\(a_i=MEX\{b_1,b_2,...,b_1\}\) 首先考虑当\(b_1,b_2,...,b_n\)为什么数时,\(a_n=MEX\{b_1,b_2,...,b_n\}\)。 然后再考虑 ......
Prefix 1364C 1364 Ehab MEXs

CF1833G Ksyusha and Chinchilla

[题目链接](https://codeforces.com/problemset/problem/1833/G) # 题解 **知识点:贪心,树形dp。** 当 $3 \not \mid n$ 时,显然无解。 考虑一种贪心策略,从叶子节点往上只,要以当前节点为根的子树大小能被 $3$ 整除,就立刻切 ......
Chinchilla Ksyusha 1833G 1833 and

How to use Promise and setTimeout to mock an API call in JavaScript All In One

How to use Promise and setTimeout to mock an API call in JavaScript All In One 如何使用 Promise 和 setTimeout 在 JavaScript 中模拟一个 API 调用 ......
JavaScript setTimeout Promise to mock

【题解】CF1854D Michael and Hotel

> 交互题。 > > 考虑题意即为找到 $1$ 所在内向基环树上的所有点。 我们考虑我们怎么找到环上的点,我们考虑我们可以 $O(\log n)$ 询问到一个环上的点,方法即为将 $k$ 定为一个大数,然后二分点集。然后我们便可以在 $O(n\log n)$ 的时间复杂度内找到所有环上的点(我们一会 ......
题解 Michael 1854D Hotel 1854

AnnotationTransactionAttributeSource is only available on Java 1.5 and higher和windows同时安装jdk7和jdk8

AnnotationTransactionAttributeSource is only available on Java 1.5 and higher和windows同时安装jdk7和jdk8 出错原因: 因为spring core org.springframework.core.JdkVer ......