monocarp and set the
The_Counterintuitive_Art_of_Memory:_Why_Retrieval_Beats_Cramming_
Introduction I have spent years as a cognitive psychologist, delving into the intricate mechanisms of memory and learning. And if there's one thing I' ......
The_Lifelong_Quest:_Building_Something_for_Others_While_Expressing_Who_You_Are
Introduction Ah, the lifelong quest! We all have one, don't we? A dream, a passion, a mission—something that we are willing to devote our lives to. Mi ......
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 ......
Solution Set before NOIP2023
香蕉公司 题意:维护 \(n\) 的排列 \(a_0\) 与 \(p\)。\(q\) 次操作,交换 \(a_0\) 中两个值或 \(p\) 中两个值,或者比较 \(a_x\) 与 \(a_y\) 的字典序大小,其中 \(a_{k,i}=a_{k-1,p_i}\)。 \(n,q\le10^5\),\( ......
P3507 [POI2010] GRA-The Minima Game
原题 一开始还以为又要整什么\(SG\)函数就直接放弃思考了,后来看了题解才发现是贪心+\(dp\) 首先先对\(a\)从小到大排序 首先先说一个错误的贪心:每个人都只选最大的那一个数。这显然是错误的(笨笨的我起初甚至是这么想的),因为玩家可以把一些可能让对方变优的数自己先选掉,来使自己走向更优的策 ......
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 ......
Java Maven Settings配置参考
介绍 快速概览 settings.xml文件中的 settings 元素包含用于定义以各种方式配置Maven执行的值的元素,如pom.xml,但不应绑定到任何特定项目或分发给受众。这些值包括本地仓库位置、备用远程仓库服务器和身份验证信息。 settings.xml文件可能位于两个地方: Maven安 ......
train the model model.fit
#train the model history = model.fit(x_train, y_train, batch_size=32, epochs=100, validation_split=0.1, shuffle=True, class_weight=class_weights, call ......
Codeforces Global Round 21 B. NIT Destroys the Universe
给一个长为 \(n\) 的数组,可以执行以下操作任意次: 选择 \(l, r(1 \leq l < r \leq n)\) ,让 \(\forall i(l \leq i \leq r), a_i = mex(\{a_l, a_{l+1}, \cdots, a_{r}\})\) 。 问最小操作数使得 ......
【题解】CF1830B The BOSS Can Count Pairs
你考虑,我们观察数据范围,发现可以是 \(O(n\sqrt n) / O(n\log n)\) 的,我们又看到乘法,便有几个大概的想法: 数论分块 \(O(\sqrt n)\) 枚举其中一个乘数 还有什么……(笔者学识浅陋,读者可以帮忙补充) 我们可以找到两种 \(O(n^2)\) 做法: \(O( ......
Codeforces Round 807 (Div. 2) B. Mark the Dust Sweeper
需要打扫 \(n\) 个房间,第 \(i\) 个房间有 \(a_i\) 的积灰。只能使用如下魔法打扫: 选择 \(i, j, (1 \leq i < j \leq n, \min_{k = i}^{j} a_i > 0)\) 。 执行 \(a_i = a_i - 1, a_j = a_j + 1\) ......
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\) 最大,找到这个数。 分 ......
The Missing Semester - 第五讲 学习笔记(二)
第五讲(二) SSH入门 介绍完命令行环境后,这半节主要介绍的是ssh的有关入门知识。SSH是Secure Shell的简称。 课程视频地址:https://www.bilibili.com/video/BV1x7411H7wa 课程讲义地址:https://missing-semester-cn. ......
【学习笔记】折半搜索 Meet In The Middle
点击查看目录 目录算法实现杂题乱写[CEOI2015 Day2] 世界冰球锦标赛 题单 oi-wiki 算法实现 我们正常的搜索应该是一个指数级的:\(2^n\)。 然而我们可以把这个搜索拆成两半,设小于整张图的限制 \(limit\) 为合法: 对于上半搜索,我们有若干符合限制的答案 \(sum_ ......
【学习笔记】折半搜索 Meet In The Middle
点击查看目录 目录算法实现 题单 oi-wiki 算法实现 我们正常的搜索应该是一个指数级的:\(2^n\)。 然而我们可以把这个搜索拆成两半,设小于整张图的限制 \(limit\) 为合法: 对于上半搜索,我们有若干符合限制的答案 \(sum_1\),对于下半搜索,我们有若干符合限制的答案 \(s ......
The adjoint technique - 2019
SIGGRAPH 2019: Deep Learning for Content Creation and Real-Time Rendering- The adjoint technique - Video 作者:Jos Stam, NVIDIA SIGGRAPH 2019 In this tal ......
转:pytorch并行训练时报错 one of the variables needed for gradient computation has been modified by an inplace operation
【PyTorch踩坑】一个排查了一下午的坑 - 知乎 (zhihu.com) ......
The CATALINA_HOME environment variable is not defined correctly
出现原因:在系统变量中,没有找到CATALINA_HOME 这个变量 解决办法:在系统中加上CATALINA_HOME 这个变量。值为Tomcat 的根目录 ......
Hack The Box 闭坑指南---Starting Point---Meow(第0层)
0x00 实验环境 靶场:windows笔记本、kali虚拟机 0x01 实验前提 (1)注册Hack The Box (自行注册) 注册htb:https://www.hackthebox.com/ (2)连接htb靶场环境: 登录htb: https://app.hackthebox.com/m ......
How to print a web page without breaking the table content in JavaScript All In One
How to print a web page without breaking the table content in JavaScript All In One
使用 JavaScript 如何在不破坏表格内容的情况下打印一个网页
......
python tk编程出现: Tcl_AsyncDelete: async handler deleted by the wrong thread
问题现象 我有一个主TK界面, 同时又创建了一个新的独立的TK窗口. 这个新的TK窗口设置为topmost, 用于超时提醒的. 这个窗口虽然是topmost的, 但是可能没有输入焦点. 我想设置一个快捷键, 用于关闭此窗口. 也就是说, 在另外的线程中关闭tk窗口. 采用的方法是在另外线程中调用ro ......
Solution Set - DP
CF101E Candies and Stones Link&Submission. DP 的状态设计和转移都是显然的,唯一的问题在于需要输出方案,而这题卡空间。会发现如果用 bitset 存下所有位置的转移,空间刚好多了一点点。所以考虑分两次,第一次只存后 10000 行的转移,然后从最终状态倒退 ......
【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\}\)。 然后再考虑 ......
[题解] CF29D Ant on the Tree
CF29D Ant on the Tree 题目知识点:LCA。 题目传送门 题意 给定一棵以 \(1\) 为节点的树,再给定树的所有叶子节点的一个序列。 现在执行一个操作:从 \(1\) 开始遍历每个节点,并返回根,要求每条边经过的次数一定为 \(2\) 。 问是否能够使得访问节点序列中叶子节点的 ......
CF1833G Ksyusha and Chinchilla
[题目链接](https://codeforces.com/problemset/problem/1833/G) # 题解 **知识点:贪心,树形dp。** 当 $3 \not \mid n$ 时,显然无解。 考虑一种贪心策略,从叶子节点往上只,要以当前节点为根的子树大小能被 $3$ 整除,就立刻切 ......
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 调用
......
【题解】CF1854D Michael and Hotel
> 交互题。 > > 考虑题意即为找到 $1$ 所在内向基环树上的所有点。 我们考虑我们怎么找到环上的点,我们考虑我们可以 $O(\log n)$ 询问到一个环上的点,方法即为将 $k$ 定为一个大数,然后二分点集。然后我们便可以在 $O(n\log n)$ 的时间复杂度内找到所有环上的点(我们一会 ......
Unknown initial character set index '255' received from server. Initial client character 解决方法
Unknown initial character set index '255' received from server. Initial client character 解决方法 mysql连接数据库时报此错误: //String url = "jdbc:mysql://localhost: ......
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 ......