摘要: for循环不应该写太复杂,可以分开两个循环,你已经学过怎么计算复杂度了吧,for循环内写太复杂没意义而且容易错。 阅读全文
posted @ 2017-04-07 16:39 xsthunder 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 先关注下斐波那契数列 f(1)=1,f(2)=1,f(n)=f(n 1)+f(n 2),对n,求f(n) 这是一个递推公式,dp的递推公式也是递推公式 O(n)暴力求解 但可以将递推公式转换成矩阵运算再加快速幂来达到O(logn)的加速。 $$ \begin{equation} \begin{bma 阅读全文
posted @ 2017-04-07 14:51 xsthunder 阅读(437) 评论(0) 推荐(0) 编辑
摘要: use js script in c 添加引用 com Microsoft Script Control 1.0 阅读全文
posted @ 2017-04-05 19:58 xsthunder 阅读(975) 评论(0) 推荐(0) 编辑
摘要: 网友年龄 cpp include using namespace std; const int M = 236; int main(){ for(int i= 0;iM)break; } } } cpp include include include include include include 阅读全文
posted @ 2017-04-04 19:57 xsthunder 阅读(1071) 评论(0) 推荐(0) 编辑
摘要: 蓝桥杯 cpp include include include using namespace std; int main(){ int n; char s[50]; stringstream ss; scanf("%d",&n); for(int i =1;i out" 阅读全文
posted @ 2017-04-04 18:09 xsthunder 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1. 用excel算日期 2. 还可以用{ }括住一行代码。。。 A方程整数解 cpp include int main(){ int n; int ans=0; scanf("%d", &n); ans+=n; while(1){ ans+=n/3; if(!(n/3))break; n=n/3+ 阅读全文
posted @ 2017-04-04 15:57 xsthunder 阅读(490) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include using namespace std; struct CNode{ int times; char data; }; typedef CNode ptr; typedef unsigned int u; typedef CNode Qs 阅读全文
posted @ 2017-04-04 14:56 xsthunder 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 预处理后 居然没发现从odd开始和从even开始的每一项符号是相反的。。。 阅读全文
posted @ 2017-04-01 23:05 xsthunder 阅读(96) 评论(0) 推荐(0) 编辑
摘要: "用字符读入比数字读入快?" cpp //cf 有毒,能用long long 就用long long //规定 sizeof(int) using namespace std; int main(){ cout 阅读全文
posted @ 2017-04-01 22:07 xsthunder 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 4/1 记忆搜索,递推公式 递推公式 需要初始值 阅读全文
posted @ 2017-04-01 10:51 xsthunder 阅读(100) 评论(0) 推荐(0) 编辑