##题面 Problem Description 任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的: F(1)=1; F(2)=2; F(n)=F(n-1)+F(n-2)(n>=3); 所以,1,2,3,5,8,13……就是菲波那契数列。 在HDOJ上 ...
分类:
其他好文 时间:
2020-07-22 15:43:22
阅读次数:
61
哈密顿绕行世界问题(HDU-2181) 题解:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 裸DFS; 代码: #include<bits/stdc++.h> using namespace std; const int m ...
分类:
其他好文 时间:
2020-07-22 02:01:11
阅读次数:
198
[Lyndon分解] HDU 6761 Minimum Index (2020多校训练) 题解 待补。 Code #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cstdi ...
分类:
其他好文 时间:
2020-07-22 01:46:30
阅读次数:
178
题意: ? 给定三个数字 \(n,c,k\) ,求以下式子 ? \(\sum_{i=0}^nF(ic)^k\%(10^9+9)\) ? 其中$F(x)$为斐波那契数列第$x$项。 ? $1\leq n,c\leq10^{18},1\leq k \leq10^5$ 分析: ? 在比赛的时候我搜索了一波 ...
分类:
其他好文 时间:
2020-07-22 01:44:09
阅读次数:
110
HDU - 2157 构造矩阵,用于转移走一步的情况。 若$i$能走到$j$,则$g[j][i]=1$,否则为$0$ 然后一开始只有$A$点累计有一种走法。 所以最后计算矩阵的$k$次方,输出$g[B][A]$即可。 #include<bits/stdc++.h> using namespace s ...
分类:
其他好文 时间:
2020-07-21 22:30:21
阅读次数:
61
代码出处:https://github.com/aespresso/a_journey_into_math_of_ml/blob/master/04_transformer_tutorial_2nd_part/BERT_tutorial/models/bert_model.py # coding=u ...
分类:
其他好文 时间:
2020-07-21 14:20:11
阅读次数:
68
题目链接 #解题思路 题面差不多已经用的算法写到脸上了,不过有个问题就是怎么判断枚举的区间符合条件,如果直接暴力的话复杂度就要乘上q,但是如果用一个变量来计数的话,就能让时间复杂度降下来。 #代码 const int maxn = 1e5+10; int n,m,a[maxn],cnt[maxn]; ...
分类:
其他好文 时间:
2020-07-21 13:37:33
阅读次数:
60
额............我也不知道(先记下) printf("%d\n", (scanf("%d", &n), n)) printf("%d\n", (~scanf("%d", &n))); 打印结果都相同........ 测试题目连接:http://acm.hdu.edu.cn/showprob ...
分类:
其他好文 时间:
2020-07-21 10:04:39
阅读次数:
80
##安装PyQt5 pip install PyQt5 -i https://pypi.douban.com/simple ##安装QTdesigner pip install PyQt5-tools -i https://pypi.douban.com/simple ##打开QTdesigner ...
分类:
其他好文 时间:
2020-07-21 09:53:55
阅读次数:
118
###题目 给定一个无序的整数数组,找到其中最长上升子序列的长度。 示例: 输入: [10,9,2,5,3,7,101,18] 输出: 4 解释: 最长的上升子序列是 [2,3,7,101],它的长度是 4。 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/pr ...
分类:
其他好文 时间:
2020-07-21 09:28:50
阅读次数:
55