Codeforces Round #226 (Div. 2)--A Bear and Raspberry,題目連結:Bear and RaspberryBear and Raspberrytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe bear decided to store some raspberry for the
Codeforces Beta Round #25 (Div. 2)--A. IQ test,IQ testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBob is preparing to pass IQ test. The most frequent task in this test is to find out which
Codeforces Round #107 (Div. 2)---A. Soft Drinking,Soft Drinkingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis winter is so cold in Nvodsk! A group of n friends decided to buy
Median of Two Sorted Arrays,mediansortedThere are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).題意:尋找兩個有序數組的中位元,要求複雜度為O(log
UVALive 6531 Go up the ultras 單調棧+RMQ,uvaliveultras題目連結:點擊開啟連結題意:給定n座山下面n個數字表示n座山的高度若這座山u合法,則要滿足:1、若u的左邊存在比u高的山,設v是u左邊距離u最近的且嚴格比u高的山,在[v,u]之間至少有一座山x,使得x和u的高度差>=150002、右邊也同理。同時滿足1、2的情況則算合法。問:輸出所有合法的山。思路:求距離某個點最近的山就是維護一個單調棧,然後給山的高度求一個RMQ。寫寫寫。