摘要: 1175 区间中第K大的数 基准时间限制:1 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 一个长度为N的整数序列,编号0 - N - 1。进行Q次查询,查询编号i至j的所有数中,第K大的数是多少。 例如: 1 7 6 3 1。i = 1, j = 3,k = 2,对应的数为7 阅读全文
posted @ 2016-03-04 21:07 yanzx6 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 线性筛法: 1 for(int i = 2; i < MAXPRIME; i++) 2 { 3 if(!visit[i]) prime[tot++] = i; 4 for(int j = 0; j < tot; j++) 5 { 6 if(i * prime[j] >= MAXPRIME) brea 阅读全文
posted @ 2016-03-04 11:56 yanzx6 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and each orders a juice cocktail. It could be from 1 t 阅读全文
posted @ 2016-03-04 11:14 yanzx6 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best programmer in the world! Now he regularly takes part 阅读全文
posted @ 2016-03-04 11:14 yanzx6 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate integers together in their spare time. Nikolay thinks 阅读全文
posted @ 2016-03-04 10:54 yanzx6 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock band on Earth. Band decided to make the most awes 阅读全文
posted @ 2016-03-04 10:47 yanzx6 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in process, manpower and supplies are coming to an end and 阅读全文
posted @ 2016-03-04 10:37 yanzx6 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. According to a proverb, every man to his own taste 阅读全文
posted @ 2016-03-04 10:30 yanzx6 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a very serious mathematician and he likes to solve se 阅读全文
posted @ 2016-03-04 10:26 yanzx6 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 2065. Different Sums Time limit: 1.0 secondMemory limit: 64 MB Alex is a very serious mathematician and he likes to solve serious problems. For exampl 阅读全文
posted @ 2016-03-04 10:25 yanzx6 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 2064. Caterpillars Time limit: 3.0 secondMemory limit: 64 MB Young gardener didn’t visit his garden for a long time, and now it’s not very pleasant th 阅读全文
posted @ 2016-03-04 10:23 yanzx6 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 2063. Black and White Time limit: 1.0 secondMemory limit: 64 MB Let’s play a game. You are given a row of n balls, each ball is either black or white. 阅读全文
posted @ 2016-03-04 10:15 yanzx6 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 2062. Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scientists from planet Nibiru are working to create an e 阅读全文
posted @ 2016-03-04 10:10 yanzx6 阅读(487) 评论(0) 推荐(0) 编辑