gallery graph 305e abc

ABC324题解

A/B 赛时没打。 C 暴力判断是相等 s[i] == t 还是替换了一个字符,或者是添加/删除了一个字符。 最后两个判断只需要交换一下 \(s\) 和 \(t\) 的顺序就可以共用一个函数了。 D 注意到 \(N\le 13\),所以平方数不会超过 \(v=10^{13}\),很容易想到暴力枚举 ......
题解 ABC 324

ABC324总结

ABC324 solved:CDE rating:Unrated C: 7min(+1) D: 7min E: 9min C const int N = 2e5 + 5; \(\rightarrow\) const int N = 5e5 + 5; 。。。 F 01分数规划,没学过。 后:就是二分答 ......
ABC 324

ABC324F Beautiful Path

给出一张 DAG,每条边有两种边权 \(b\) 与 \(c\),求一条从 \(1\) 到 \(n\) 的路径,问路径经过的边的 \(\dfrac{\sum b}{\sum c}\) 的最大值是多少。 \(n, m \le 2 \times 10^5\)。 这不是经典 01 分数规划吗?将题目中的要求 ......
Beautiful 324F Path ABC 324

【Unity3D】Shader Graph简介

1 Shader Graph 简介 ​ Shader Graph 是 Unity 官方在 2018 年推出的 Shader 制作插件,是图形化的 Shader 制作工具,类似于 Blender 中的 Shader Editor 和 UE 中的 Material Editor,它使用流程图的形式表达顶 ......
Unity3D 简介 Shader Unity3 Unity

abc270F - Transportation

F - Transportation 一天遇到两道生成树的题目,还都不会做,菜哭的一天。 这题的做法是另外建两个点n+1,n+2,然后做生成树,因为我们只要前n个点联通就行,后面两个点不一定,那么枚举一下就行。 #include<cstdio> #include<algorithm> #includ ......
Transportation 270F abc 270

题解 [ABC258G] Triangle

题目链接 \(\rm O(n^3)\) 枚举 \(i,j,k\) 的算法是显然的。 考虑优化掉一个 \(n\),如果枚举 \(i,j\),那么显然需要找出有多少个 \(k\) 同时满足 \(a_{i,k}=a_{j,k}=1\),我们可以将 \(a_i\) 和 \(a_j\) 看作两个二进制数,那么 ......
题解 Triangle 258G ABC 258

abc282E - Choose Two and Eat One

E - Choose Two and Eat One 非常巧妙的一集 可以将整个局面看作一张图,选两个数获得的score就是它们的边权,然后做最大生成树,不难发现操作和建树之间是一一对应的。 #include<cstdio> #include<algorithm> #include<cstring> ......
Choose 282E abc 282 Two

Trying to backward through the graph a second time

原因是把创建loss的语句loss_aux = torch.tensor(0.)放在循环体外了,可能的解释是第一次backward后把计算图删除,第二次backward就会找不到父节点,也就无法反向传播。参考:https://stackoverflow.com/questions/55268726/ ......
backward through Trying second graph

ABC214H Collecting 题解

前言 这是一道比较神仙的题目,其后半部分的建图是比较困难想到的,前半部分还是较为容易的。 题意 现在有一张\(N\)个点\(M\)条边的有向图,每个点有一个点权\(a_i\),现在要找出\(K\)条路径,使得这些路径的并集的点权和尽量大。现在求出点权和。 \(N, M \le 2\times 10^ ......
题解 Collecting 214H ABC 214

Fi-GNN: Modeling Feature Interactions via Graph Neural Networks for CTR Prediction

目录概Fi-GNN代码 Li Z., Cui Z., Wu S., Zhang X. and Wang L. Fi-GNN: Modeling feature interactions via graph neural networks for ctr prediction. CIKM, 2019. ......

[ABC245G] Foreign Friends 题解

[ABC245G] Foreign Friends 题解 想法 考虑所有颜色相同的弱化版。 这种情况下,只需要把所有特殊点都推入队列之后跑多源 Dijkstra 即可。 思路 正解与上述做法大致相同。 如果有颜色限制,那么可以考虑这个神仙思路: 把所有特殊点的颜色用二进制表示,对于每一位,这一位是 ......
题解 Foreign Friends 245G ABC

[ABC321C] 321-like Searcher

Problem 题目简述 给你一个 \(K\),求出 \([1 \sim K]\) 区间内有多少个 321-like Number。 321-like Number 的定义: 每一位上的数字从左到右严格单调递减。 或者说,若它有 \(d\) 位,对于 \(\forall i\in[1,d-1]\), ......
321 Searcher 321C like ABC

Z2219. [ABC235E] MST + 1

先写一发LCA #include<bits/stdc++.h> using namespace std; int n,q,x,y,dep[500005],jump[500005][22]; vector<int>d[500005]; void findep(int p,int f,int dp) { ......
2219 235E ABC 235 MST

Educational Codeforces Round 105 (Rated for Div. 2) A. ABC String

给一个长为 \(n\) 的字符串 \(a\) ,\(n\) 是偶数,字符串中只包含三种字符 \(A, B, C\) 。规定一个合法的字符串为一个符合入栈规则的字符串。 需要构造一个长为 \(n\) 的括号字符串 \(b\) 。 \(b\) 是一个合法的括号序列 \(\forall 1 \leq i ......
Educational Codeforces String Round Rated

ABC三类地址、子网掩码及子网划分

ABC三类地址、子网掩码及子网划分 https://blog.csdn.net/weixin_43603028/article/details/103563822 A类适用的类型为大型网络,A类网络地址数量较少,有126个网络,每个网络支持的最大主机数为256的3次方-2=16777214台; B类 ......
地址 ABC

Graph Laplacian for Semi-Supervised Learning

目录概符号说明Graph-Laplacian for SSL Streicher O. and Gilboa G. Graph laplacian for semi-supervised learning. arXiv preprint arXiv:2301.04956, 2023. 概 标题取得有 ......

abc207

A - Repression 6 B - Hydrate 98 初始有a个蓝球,每次增加b个蓝球和c个红球,问至少几次后蓝球与红球的数量比不超过d 化一下式子,\((a+bk)/(ck)\le d\iff k\ge a/(dc-b)\)。那么分母小于等于0时无解,否则上取整 C - Many Seg ......
abc 207

Graph RAG: 知识图谱结合 LLM 的检索增强

RAG(Retrieval Argumented Generation)这种基于特定任务/问题的文档检索范式中,我们通常先收集必要的上下文,然后利用具有认知能力的机器学习模型进行上下文学习(in-context learning),来合成任务的答案。这次,我们借助 LLM 的力量,强化下 RAG。 ......
图谱 知识 Graph RAG LLM

[abc306h/ex] Balance Scale

Ex - Balance Scale 考虑只有>和<的情况,相当于给每条边定向,当且仅当成环时不合法,那么方案数就是\(DAG\)的方案数 对于=,就是将两个点合并 然后对于一般的求\(n\)个点的\(DAG\)的方案数为\(\sum_{i=1}^n (-1)^{i+1}C_n^i2^{i\time ......
Balance Scale abc 306 ex

[abc302f] Merge Set

F - Merge Set 显然要建图 首先,我们有一个粗略的想法,对于同一集合\(S_i\)内的元素,\(S_{i,j}\)与\(S_{i,j+1}\)间连一条无向的标号为\(i\)的边 那么题目显然是要我们跑最短路,若到达\(x\)的边为\(i\),然后从\(x\)向外走到点\(y\),走的边若 ......
Merge 302f abc 302 Set

[abc313 h/ex] Group Photo

Ex - Group Photo 很牛的题 设\(A_0=A_{n+1}=INF\),那么对于每个\(B_i\)有\(B_i>\min(A_{i-1},A_i)\),所以考虑设\(C_i\)表示\(min(A_{i-1},A_i)\),那么有\(B_i>C_i\),显然,若我们将\(C\)从小到大排 ......
Group Photo abc 313 ex

35KV母线(ABC三相)电流电压温度环境温湿度振动数据采集

一.采集需求: 1、35KV母线(ABC三相),电流、电压、温度;环境温湿度、振动等数据采集 2、采集频率:分钟级别(1分钟),可以的情况下,尝试秒级采集 3、传感器供电:外供电和电池供电可选(电池供电首选) 4、内网网线形式对接自己平台 5、所有传感器采集的数据统一集中到一个主机后(多种传感器对接 ......
母线 数据采集 电流 电压 温度

【ABC320C】题解

AtCoder Beginner Contest 320 Problem C - Slot Strategy 2 (Easy) 题解 题目简述 给定 \(3\) 个长度为 \(m\) 的转盘,转动过后三个转盘分别可以在不同的时间停下,求停下时所有转盘都显示相同数字的最小时间。 思路 由于这题 \(m ......
题解 320C ABC 320

【ABC320D】题解

AtCoder Beginner Contest 320 Problem D - Relative Position 题解 题目保证不矛盾,就可以直接 vector 建图,然后 dfs 一遍,边权为 \((w_x,w_y)\) 表示坐标的差,从 \(u=1\) 开始搜索,设点 \(u,v\) 有一条 ......
题解 320D ABC 320

记录fluuter gallery-master官方项目 遇到的两个bug

最近研究flutter web,下载了官方项目,遇到了两个bug Because gallery depends on flutter_localizations from sdk which depends on intl 0.18.0, intl 0.18.0 is required. So, ......
gallery-master 两个 fluuter gallery 项目

Go - Finding the Shortest Path on a Graph

Problem: You want to find the shortest path between two nodes on a weighted graph. Solution: Use Dijkstra’s algorithm to find the shortest path betwee ......
Shortest Finding Graph Path the

AttributeError: module 'tensorflow' has no attribute 'get_default_graph'

具体操作命令是:创建一个python <3.8的虚拟环境。conda create -n your_env_name python=3.6激活并进入该环境。activate your_env_name安装1.x版本的tensorflow。pip install tensorflow==1.15.0 ......

AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

环境配置: python3.7 tensorflow2.0 Window 10初始代码:tf.reset_default_graph()解决方法:import tensorflow as tftf.compat.v1.reset_default_graph()或者是这样:import tensorf ......

【ABC322C】题解

AtCoder Beginner Contest 322 Problem C - Festival 题解 Meaning - 题意简述 给定 \(N\) 和 \(M\),还有 \(M\) 个正整数 \(a_1 \sim a_n\),对于每个 \(i \le n\),求出 \(a\) 中第一个大于等于 ......
题解 322C ABC 322

【ABC322D】题解

AtCoder Beginner Contest 322 Problem D - Polyomino 题解 Meaning - 题意简述 给定三个字符矩阵,求它们能不能拼在一起变成一个 \(4 \times 4\) 的全部是 # 的矩阵。 Solution - 题解思路 大模拟。说简单也不简单,很复 ......
题解 322D ABC 322