分析: 当n=1时ans=4=f(5)-1; n=2,ans=12=f(7)-1; n=3,ans=33=f(9)-1; 于是大胆猜想ans=f(2*k+3)-1。 之后用矩阵快速幂求解f(n)即可,O(logn)。 AC code: 1 #include<bits/stdc++.h> 2 usin ...
分类:
其他好文 时间:
2019-09-03 22:06:08
阅读次数:
80
代码十分简单,通过对比vs,得知gcc调用的是ostream.tcc文件中的write函数write(const _CharT* __s, streamsize __n)。 vs中是定义在ostream文件中的write(const _Elem* _Str,streamsize _Count),gc ...
分类:
其他好文 时间:
2019-09-03 13:42:26
阅读次数:
141
CSE599:online and adaptive machine learning Lecture 3:Stochastic Multi-Armed Bandits, Regret Minimization csdn bandit 算法(3) -- UCB算法 推荐系统的EE问题及Bandit算 ...
分类:
其他好文 时间:
2019-09-02 09:40:39
阅读次数:
83
Problem Description 给定三个数 $k,pa,pb$ ,每次有 $\frac{pa}{pa+pb}$ 的概率往后面添加一个 ,有 $\frac{pb}{pa+pb}$ 的概率往后面添加一个 ,当出现了 $k$ 个形如 的子序列(不用连续)时停止。 求最后子序列 的期望个数。 答案对 ...
分类:
其他好文 时间:
2019-09-01 17:00:19
阅读次数:
67
Bahiyyah has a convex polygon with nn vertices P0,P1,?,Pn?1P0,P1,?,Pn?1 in the counterclockwise order. Two vertices with consecutive indexes are adjac ...
分类:
其他好文 时间:
2019-09-01 10:37:36
阅读次数:
80
7题弟弟,被各位半小时13题的大佬打惨了(滑稽) 签到题就不写了。 F :Moving On (1247ms) 题意:给定大小为N的带点权,带边权的完全图,N<200。 然后Q次询问,每次给出(u,v,w),让你求在除了起点终点的其他途经点的点权都<=w的条件下的最短路。 思路:可以离线做的话,显然 ...
分类:
其他好文 时间:
2019-09-01 10:30:13
阅读次数:
77
这场真的是ICPC之耻,题目居然直接抄去年宁夏现场赛题,导致短短半个小时一片ak,真的让人说不出话。如果国内ACM从此走向没落,宁夏理工学院绝对有其不可推卸的责任! 虽然如此,但题目质量不错,题解还是要写的。 题目链接:https://www.jisuanke.com/contest/2991 (c ...
分类:
其他好文 时间:
2019-08-31 23:14:48
阅读次数:
107
It is my great honour to introduce myself to you here. My name is Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper L ...
分类:
其他好文 时间:
2019-08-31 19:43:43
阅读次数:
107
FFmpeg 截取视频图片 标签(空格分隔): linux 安装FFmpeg 官网:http://www.ffmpeg.org/ 这里主要是linux环境下的安装 1. wget http://ffmpeg.org/releases/ffmpeg 3.1.3.tar.bz2 2. ar jxvf f ...
分类:
其他好文 时间:
2019-08-31 19:17:24
阅读次数:
47
CDQ分治套斜率优化 有一些特殊的动态规划题目,貌似可以化作$\frac{f_j f_k}{g_j g_k} include include include include include define int long long define maxn 300000 define INF 0x3f ...
分类:
其他好文 时间:
2019-08-31 19:13:45
阅读次数:
52