摘要: 题目描述 已知有两个字串A,BA,BA,B及一组字串变换的规则(至多666个规则): A1A_1A1​ ->B1 B_1B1​ A2A_2A2​ -> B2B_2B2​ 规则的含义为:在 AAA中的子串 A1A_1A1​ 可以变换为B1 B_1B1​,A2A_2A2​ 可以变换为 B2B_2B2​ 阅读全文
posted @ 2019-01-15 20:16 NKDEWSM 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 每次交换:逆序对的数量+1或者-1; 假设最后逆序对数量为 sum; ①x+y=3n; ②x-y=sum; -> 3n+sum为偶数; 所以 n 和 sum 必须奇偶一样; 阅读全文
posted @ 2019-01-15 18:50 NKDEWSM 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Some company is going to hold a fair in Byteland. There are n n n towns in Byteland and m m m two-way roads between towns. Of course, you can rea 阅读全文
posted @ 2019-01-15 18:46 NKDEWSM 阅读(808) 评论(0) 推荐(0) 编辑
摘要: 题意翻译 题目大意: nnn个位置,每个位置有两个属性s,cs,cs,c,要求选择3个位置i,j,ki,j,ki,j,k,使得si<sj<sks_i<s_j<s_ksi​<sj​<sk​,并使得ci+cj+ckc_i+c_j+c_kci​+cj​+ck​最小 输入格式: 一行一个整数,nnn,3<= 阅读全文
posted @ 2019-01-15 18:38 NKDEWSM 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 题意翻译 题目大意 输入一个 xxx ,一个 yyy ,求是 xyx^yxy 大还是 yxy^xyx 大。 (1≤x,y≤109)(1≤x,y≤10^9)(1≤x,y≤109) 输入输出格式 输入格式 一行,两个整数 x,yx,yx,y 。 输出格式 若 xyx^yxy > yxy^xyx ,输出" 阅读全文
posted @ 2019-01-15 18:36 NKDEWSM 阅读(237) 评论(0) 推荐(0) 编辑
摘要: You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems: the Power Gem of purple color, the Time G 阅读全文
posted @ 2019-01-15 18:34 NKDEWSM 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Although Farmer John has no problems walking around the fair to collect prizes or see the shows, his cows are not in such good shape; a full day 阅读全文
posted @ 2019-01-15 10:36 NKDEWSM 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目描述 佳佳碰到了一个难题,请你来帮忙解决。 对于不定方程a1+a2+…+ak-1+ak=g(x),其中k≥2且k∈N,x是正整数,g(x)=x^x mod 1000(即x^x除以1000的余数),x,k是给定的数。我们要求的是这个不定方程的正整数解组数。 举例来说,当k=3,x=2时,分别为(a 阅读全文
posted @ 2019-01-15 09:33 NKDEWSM 阅读(316) 评论(0) 推荐(0) 编辑