打开/关闭搜索
搜索
打开/关闭菜单
1706
4999
924
6.3万
RIA | Wiki
导航
首页
最近更改
随机页面
MediaWiki帮助
上传文件
RIA社群
RIA官网&红报社
RIA论坛
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
登录
目前wiki关闭了自行注册账号的功能,如需注册账号,请查阅
Help:注册账号
。
查看“︁用户:HermitOvO”︁的源代码
♀
39次编辑
2022年8月17日 (星期三)
加入
查看
阅读
查看源代码
查看历史
associated-pages
用户页
讨论
更多操作
←
用户:HermitOvO
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、已验证用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
这里是慕斯sama!<s>(一直想改名为musesama,但是因为hermit的名称已经在各大论坛上了索性就用这个了)</s> 会点中式建筑,有点红石技艺,浅尝辄止pvp,正在被带领学习中世纪建筑( 不善交际的美少女一枚捏(大概 * '''<big>出没地点:</big>''' [https://www.bilibili.com/ bilibili] [[bbs:|zth-ria]] [https://www.luogu.com.cn/ 洛谷] [http://codeforces.com/ codeforce] [https://atcoder.jp/ AtCoder] [https://www.acwing.com/ Acwing] [https://www.52pojie.cn/ 吾爱论坛] 各大群聊 * '''<big>记不住的东西:</big>''' 算法知识点:<code>#include</code> {| class="mw-collapsible mw-collapsed wikitable" |- ! colspan=3 | FFT 前方检测到核聚变打击,请谨慎打开! |- | <code> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const int N = 300000; const double PI = acos(-1); struct Complex { double x, y; Complex operator+ (const Complex& t) const { return {x + t.x, y + t.y}; } Complex operator- (const Complex& t) const { return {x - t.x, y - t.y}; } Complex operator* (const Complex& t) const { return {x * t.x - y * t.y, x * t.y + y * t.x}; } }a[N], b[N]; char s1[N], s2[N]; int res[N]; int rev[N], bit, tot; void fft(Complex a[], int inv) { for (int i = 0; i < tot; i ++ ) if (i < rev[i]) swap(a[i], a[rev[i]]); for (int mid = 1; mid < tot; mid *= 2) { auto w1 = Complex({cos(PI / mid), inv * sin(PI / mid)}); for (int i = 0; i < tot; i += mid * 2) { auto wk = Complex({1, 0}); for (int j = 0; j < mid; j ++, wk = wk * w1) { auto x = a[i + j], y = wk * a[i + j + mid]; a[i + j] = x + y, a[i + j + mid] = x - y; } } } } int main() { scanf("%s%s", s1, s2); int n = strlen(s1) - 1, m = strlen(s2) - 1; for (int i = 0; i <= n; i ++ ) a[i].x = s1[n - i] - '0'; for (int i = 0; i <= m; i ++ ) b[i].x = s2[m - i] - '0'; while ((1 << bit) < n + m + 1) bit ++ ; tot = 1 << bit; for (int i = 0; i < tot; i ++ ) rev[i] = ((rev[i >> 1] >> 1)) | ((i & 1) << (bit - 1)); fft(a, 1), fft(b, 1); for (int i = 0; i < tot; i ++ ) a[i] = a[i] * b[i]; fft(a, -1); int k = 0; for (int i = 0, t = 0; i < tot || t; i ++ ) { t += a[i].x / tot + 0.5; res[k ++ ] = t % 10; t /= 10; } while (k > 1 && !res[k - 1]) k -- ; for (int i = k - 1; i >= 0; i -- ) printf("%d", res[i]); return 0; } </code> |} [[category:玩家]]
返回
用户:HermitOvO
。
查看“︁用户:HermitOvO”︁的源代码
♀
39次编辑
2022年8月17日 (星期三)
加入