Query on a tree Time Limit: 5000ms Memory Limit: 262144KB This problem will be judged on SPOJ. Original ID: QTREE64-bit integer IO format: %lld Java class name: Main Prev Submit Status Statistics Discuss Next Font Size: + - Type: None Graph…
Arranged probability If a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, P(BB) = (15/21)×(14/20) = 1/2. The n…
题目 Source http://www.spoj.com/problems/DQUERY/en/ Description Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elem…
SPOJ - GSS3 Can you answer these queries III Description You are given a sequence A of N (N <= 50000) integers between -10000 and 10000. On this sequence you have to apply M (M <= 50000) operations: modify the i-th element in the sequence or for giv…
[BZOJ2318]Spoj4060 game with probability Problem Description Alice和Bob在玩一个游戏.有n个石子在这里,Alice和Bob轮流投掷硬币,如果正面朝上,则从n个石子中取出一个石子,否则不做任何事.取到最后一颗石子的人胜利.Alice在投掷硬币时有p的概率投掷出他想投的一面,同样,Bob有q的概率投掷出他相投的一面. 现在Alice先手投掷硬币,假设他们都想赢得游戏,问你Alice胜利的概率为多少. Input 第一行一个正整数t,…
We start with the fuzzy binomial. Then we discuss the fuzzy Poisson probability mass function. Fuzzy Binomial Let $E$ be a non-empty, proper subset of $X=\{x_1,x_2,x_3,...,x_n\}$. Let $P(E)=p$ so that $P(E^{'})=1-p$ where $p\in (0,1)$. Suppose we hav…