使用Mathematica绘制股票相关曲线 Mathematica是个好东西。虽然早有耳闻功能强大,但是没想到强大到这种地步。 原本因为课程原因,研究了一下如何在Mathematica里绘制股票数据。不过现在停止,只完成了一小部分。剩下的……想折腾的话,按照已经有的代码,能容易改出来其他功能。 数据来源 首先要说的是,Mathematica中自行提供了非权威的金融数据。这对我们很方便。 使用命令FinancialData,就可以获取大量需 2019-09-20 闲扯
一些筛法的题 技巧 自然溢出 自然溢出不会影响低位数据,所以有的时候你不需要取模,而是一个unsigned. 除法取模 对于式子 a×bcmod p≡a×bmod cpc\frac {a \times b}{c} \mod p \equiv \frac{a \times b \mod cp}{c} ca×bmodp≡ca×bmodcp 细节 注意数据类型,例如6*(ll)(1<< 2019-09-05 学习
[HDU 6704] Kth Occurrence You are given a string S consisting of only lowercase english letters and some queries. For each query (l,r,k), please output the starting position of the k-th occurence of the substring SlSl+1…Sr in 2019-08-25 code
记一个bug (HDU 6703) You are given an array a1,a2,…,an(∀i∈[1,n],1≤ai≤n). Initially, each element of the array is unique. Moreover, there are m instructions. Each instruction is in one of the following two formats: (1,pos 2019-08-24 code
[FZU 2204]Seven n个有标号的球围成一个圈。每个球有两种颜色可以选择黑或白染色。问有多少种方案使得没有出现连续白球7个或连续黑球7个。 对方案数mod 2015,球最多有100000个。 分析 考虑对于非环状球的答案计算,可以设sum(i,k)sum(i,k)sum(i,k)表示第i个球为k色时的方案数。其计算非常显然 sum(i,k)=∑1≤j≤6sum(i−j,1−k)sum(i,k)=\sum_{1\leq 2019-08-10 code
[HDU6638] Snowy Smile There are n pirate chests buried in Byteland, labeled by 1,2,…,n. The i-th chest’s location is (xi,yi), and its value is wi, wi can be negative since the pirate can add some poisonous gases into the c 2019-08-07 code
莫队算法 为了做课件又加了很多东西。 对于可以离线的区间询问问题,莫队算法提出了一种可以在O(nn)O(n\sqrt n)O(nn)(无修改),O(n5/3)O(n^{5/3})O(n5/3)(带修改)内得出答案的方法。 主要的思路是对询问离线并分块,利用在2个区间间答案的快速转移(如果无法找到快速转移的方法,就没法用了)降低复杂度。 2019-08-03 学习 #莫队 #分块 #LCA
Distribution of Books zz6d likes reading very much, so he bought a lot of books. One day, zz6d brought n books to a classroom in school. The books of zz6d is so popular that K students in the classroom want to borrow his b 2019-08-01 code
Fansblog Farmer John keeps a website called ‘FansBlog’ .Everyday , there are many people visited this blog.One day, he find the visits has reached P , which is a prime number.He thinks it is a interesting fact 2019-08-01 code