Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss Incubator, she is trapped in a labyrinth called LOOPS. The planform of the LOOPS is a rectangle of R…
Background If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.     And Cain talked with Abel his brother: and it came to pass, when they w…
When wake up, lxhgww find himself in a huge maze. The maze consisted by N rooms and tunnels connecting these rooms. Each pair of rooms is connected by one and only one path. Initially, lxhgww is in room 1. Each room has a dangerous trap. When lxhgww…
数学期望 P=Σ每一种状态*对应的概率. 因为不可能枚举完所有的状态,有时也不可能枚举完,比如抛硬币,有可能一直是正面,etc.在没有接触数学期望时看到数学期望的题可能会觉得很阔怕(因为我高中就是这么认为的,对不起何老板了QwQ),避之不及. 但是现在发现大多数题就是手动找公式或者DP推出即可,只要处理好边界,然后写好方程,代码超级简短.与常规的求解不同,数学期望经常逆向推出. 比如常规的dp[x]可能表示到了x这一状态有多少,最后答案是dp[n].而数学期望的dp[x]一般表示到了x这一状态还…
好久之前学过,记得是一次亚洲区的前几天看了看概率dp,然后亚洲区就出了一道概率dp,当时虽然做上了,但是感觉有很多地方没懂,今天起早温习了一下,觉得很多地方茅塞顿开,果然学习的话早上效果最好了. 首先来看一道最基础概率dp 题意是,有一个软件,有s个子系统,会产生n种bug. 某个程序员一天能发现一个bug,这个bug是这n种bug中的一种,然后发生在某个子系统中. 问,找到所有的n种bug,且每个子系统都找到bug,这样所要的天数,的期望. 期望,可以分解成多个子期望的加权和,权为子期望发生的…
LOOPS Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others) Total Submission(s): 1864    Accepted Submission(s): 732 Problem Description Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help h…
java基础系列(三)---HashMap java基础系列 java基础系列(一)---String.StringBuffer.StringBuilder java基础系列(二)---Integer java基础系列(三)---HashMap 这是我的博客目录,欢迎阅读 基本概念 节点: Node<Key,Value>,存放key和value static class Node<K,V> implements Map.Entry<K,V> { final int ha…
java基础解析系列(三)---HashMap java基础解析系列 java基础解析系列(一)---String.StringBuffer.StringBuilder java基础解析系列(二)---Integer java基础解析系列(三)---HashMap 这是我的博客目录,欢迎阅读 基本概念 节点: Node<Key,Value>,存放key和value static class Node<K,V> implements Map.Entry<K,V> { fi…
[C++自我精讲]基础系列三 重载 0 前言 分二部分:函数重载,操作符重载. 1 函数重载 函数重载:指在同一名字空间中,函数名称相同,参数类型.顺序或数量不同的一类函数,同一函数名的函数能完成不同功能. //非函数重载,只是返回值不一样 void Fun(int i); int Fun(int i); //非函数重载,不在同一名字空间 namespace A { int Add(int i, int j); }; namespace B { float Add(float i, float…
概率类题目一直比较弱,准备把kuangbin大师傅总结的这篇题刷一下! 我把下面的代码换成了自己的代码! 原文地址:http://www.cnblogs.com/kuangbin/archive/2012/10/02/2710606.html *************************************************************** 概率DP主要用于求解期望.概率等题目. 转移方程有时候比较灵活. 一般求概率是正推,求期望是逆推.通过题目可以体会到这点. 首先…