摘要:
每次交换:逆序对的数量+1或者-1; 假设最后逆序对数量为 sum; ①x+y=3n; ②x-y=sum; -> 3n+sum为偶数; 所以 n 和 sum 必须奇偶一样; 阅读全文
摘要:
题目描述 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 阅读全文
摘要:
题意翻译 题目大意: 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<= 阅读全文
摘要:
题意翻译 题目大意 输入一个 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 ,输出" 阅读全文
摘要:
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 阅读全文
摘要:
题目描述 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 阅读全文
摘要:
题目描述 佳佳碰到了一个难题,请你来帮忙解决。 对于不定方程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 阅读全文