摘要: 2023-5-5 RISC-X x0 寄存器 RISC-V有32个通用寄存器,其中第1个寄存器x0硬编码为0,即读出来总是0,写进去总是被丢弃。 可以很方便的简单化 取反,nor 等操作(可以有很多,没记住所以,没列出来 make include 机制 当 make 看到include 指令时,会先 阅读全文
posted @ 2023-05-05 20:46 yesuweiYYYY 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 鉴于fft的题在当今ICPC已经成为签到题了,还有很有必要掌握一些进阶应用。 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define maxn 400005 # 阅读全文
posted @ 2021-11-20 10:13 yesuweiYYYY 阅读(27) 评论(0) 推荐(0) 编辑
摘要: #include<bits\stdc++.h> using namespace std; #define int long long void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){if(c=='-')y=-1;c 阅读全文
posted @ 2021-11-12 22:19 yesuweiYYYY 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 存一下,可以用来对比找bug #include<bits\stdc++.h> using namespace std; #define int long long void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){i 阅读全文
posted @ 2021-11-12 18:47 yesuweiYYYY 阅读(23) 评论(0) 推荐(0) 编辑
摘要: #include<bits\stdc++.h> using namespace std; const int N=600; const double eps= 1e-10; struct P{ double x,y; P(){x=y=0;} P(double _x,double _y){x=_x,y 阅读全文
posted @ 2021-11-12 13:39 yesuweiYYYY 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define N 1000010 const int mod = 1000000007; const int inf = 1000000007; const double eps = 1e-9; void i 阅读全文
posted @ 2021-11-11 17:03 yesuweiYYYY 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 注意,spfa可能被卡,图中存在负权 #include<bits/stdc++.h> using namespace std; #define int long long const int _ = 2e5+10; const int N = 1010,inf=0x3f3f3f3f; void in 阅读全文
posted @ 2021-11-09 11:19 yesuweiYYYY 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 原题 P2774 方格取数问题 题目描述 有一个 m 行 n 列的方格图,每个方格中都有一个正整数。现要从方格中取数,使任意两个数所在方格没有公共边,且取出的数的总和最大,请求出最大的和。 解法: 对图黑白染色。 加边: ①相邻黑白点 连边 边全inf ②S → 白点 边权为cost ③黑点 → T 阅读全文
posted @ 2021-11-08 22:03 yesuweiYYYY 阅读(20) 评论(0) 推荐(0) 编辑
摘要: GarsiaWachs算法 一个算法,证明网上没找到。 求石子合并问题的优化。 step1: 找出第一个 a_k-1 < a_k+1 step2: 合并a_k-1 + a_k = TmpA step3: 将TmpA移动至数组中第一个大于TmpA的数的后面。 step4: 迭代至数组收敛。 原题石子合 阅读全文
posted @ 2021-11-08 11:55 yesuweiYYYY 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 模拟退火算法 原题 luoguP1337 题意: #include <iostream> #include <cmath> #include <cstdio> #define abs(x) ((x) >= 0 ? (x) : (-(x))) using namespace std; int n; d 阅读全文
posted @ 2021-11-08 10:59 yesuweiYYYY 阅读(21) 评论(0) 推荐(0) 编辑