原题链接 Problem Description You are a "Problem Killer", you want to solve many problems. Now you have n problems, the i-th problem's difficulty is represented by an integer ai (1≤ai≤109).For some strange reason, you must choose some integer l and r…
Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDE In the equation above, a letter stands for…
D. Brand New Problem 题目连接: http://www.codeforces.com/contest/201/problem/D Description A widely known among some people Belarusian sport programmer Lesha decided to make some money to buy a one square meter larger flat. To do this, he wants to make a…
A- Irrational problem p Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d& %I64 Description Little Petya was given this problem for homework: You are given function Irrational problem (here Irrational problem represents the operationof…
A - Noldbach problem 题面链接 http://codeforces.com/contest/17/problem/A 题面 Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two primes. That got Nic…
B. Far Relative's Problem 题目连接: http://www.codeforces.com/contest/629/problem/B Description Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of…
题意:给你一组数a[n],求满足a[i] < a[k] < a[j] (i <= k <= j)的最大的 j - i . 析:在比赛时,我是暴力做的,虽然错了好多次,后来说理解是rmq,我又用rmq写了一次,发现rmq还没有我暴力快,rwq 2000多,暴力才700. 暴力中加了一个优化条件就是前枚举 i 时,下一个 i 值不一定是i+1,而是满足条件中的最大值的位置.这样优化就是时间很短了. 如果用rmq,就得用两个dp数组分别记录最大值和最小值的下标,然后枚举 i,在i+1 -…