03 2016 档案
摘要:1201 整数划分 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} {1,5} {2,4} {1,2,3},共4种。由于数据较大,输出Mod 10^9 + 7的结果即可。 Input 输
阅读全文
摘要: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
阅读全文
摘要:线性筛法: 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate integers together in their spare time. Nikolay thinks
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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.
阅读全文
摘要:2062. Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scientists from planet Nibiru are working to create an e
阅读全文

浙公网安备 33010602011771号