摘要: Discription You are given an array a consisting of n integers, and additionally an integer m. You have to choose some sequence of indices b1, b2, ..., 阅读全文
posted @ 2018-01-22 10:08 蒟蒻JHY 阅读(400) 评论(0) 推荐(0) 编辑
摘要: Discription This time I need you to calculate the f(n) . (3<=n<=1000000) f(n)= Gcd(3)+Gcd(4)+…+Gcd(i)+…+Gcd(n). Gcd(n)=gcd(C[n][1],C[n][2],……,C[n][n-1 阅读全文
posted @ 2018-01-22 08:47 蒟蒻JHY 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Discription Number theory is interesting, while this problem is boring. Here is the problem. Given an integer sequence a 1, a 2, …, a n, let S(i) = {j 阅读全文
posted @ 2018-01-21 19:30 蒟蒻JHY 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Discription Given N integers A1, A2, …. AN, Dexter wants to know how many ways he can choose three numbers such that they are three consecutive terms 阅读全文
posted @ 2018-01-21 18:19 蒟蒻JHY 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目描述 “余”人国的国王想重新编制他的国家。他想把他的国家划分成若干个省,每个省都由他们王室联邦的一个成员来管理。 他的国家有n个城市,编号为1..n。一些城市之间有道路相连,任意两个不同的城市之间有且仅有一条直接或间接的道路。为了防止管理太过分散,每个省至少要有B个城市,为了能有效的管理,每个省 阅读全文
posted @ 2018-01-21 14:49 蒟蒻JHY 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Description 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。 2、 R P Col 把第P支画笔替换为颜色Col。为了满足墨墨的要求,你知道你需要干什 阅读全文
posted @ 2018-01-21 11:26 蒟蒻JHY 阅读(195) 评论(0) 推荐(0) 编辑
摘要: (题面都一样,就不贴了) 今天讲了分块,于是就用分块写了一下这道平衡树模板题hh 离散化之后按权值分块即可,跑得竟然比我平衡树的代码还快hhh 阅读全文
posted @ 2018-01-21 09:23 蒟蒻JHY 阅读(291) 评论(1) 推荐(0) 编辑
摘要: 题目描述 Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although 阅读全文
posted @ 2018-01-20 16:38 蒟蒻JHY 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定两个字符串,求出在两个字符串中各取出一个子串使得这两个子串相同的方案数。两个方案不同当且仅当这两个子串中有一个位置不同。 输入输出格式 输入格式: 两行,两个字符串s1,s2,长度分别为n1,n2。1 <=n1, n2<= 200000,字符串中只有小写字母 输出格式: 输出一个整数表 阅读全文
posted @ 2018-01-20 11:11 蒟蒻JHY 阅读(408) 评论(0) 推荐(0) 编辑
摘要: discription Given the value of N, you will have to find the value of G. The definition of G is given below:Here GCD(i, j) means the greatest common di 阅读全文
posted @ 2018-01-20 09:16 蒟蒻JHY 阅读(178) 评论(0) 推荐(0) 编辑