随笔分类 - cf
摘要:Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us. The girl lives in house m of a vil
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#pragma GCC optimize(2) using na...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#pragma GCC optimize(2) using na...
阅读全文
摘要:题意翻译 题意简述 给出qqq组询问,每组询问给出l,r,dl,r,dl,r,d,求一个最小的正整数xxx满足d∣x d | x\ d∣x 且x̸∈[l,r] x \not\in [l,r]x̸∈[l,r] 输入格式 第一行一个正整数q(1≤q≤500)q(1 \leq q \leq 500)q(1
阅读全文
摘要:每次交换:逆序对的数量+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
阅读全文
摘要:As we know, DZY loves playing games. One day DZY decided to play with a n × m matrix. To be more precise, he decided to modify the matrix with exactly
阅读全文
摘要:DZY has a sequence a, consisting of n integers. We'll call a sequence ai, ai + 1, ..., aj (1 ≤ i ≤ j ≤ n) a subsegment of the sequence a. The value (j
阅读全文
摘要:DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value wc. For each special string
阅读全文
摘要:DZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order they are given, into the hash table. For the
阅读全文
摘要:Jeff got 2n real numbers a1, a2, ..., a2n as a birthday present. The boy hates non-integer numbers, so he decided to slightly "adjust" the numbers he'
阅读全文
摘要:One day Jeff got hold of an integer sequence a1, a2, ..., an of length n. The boy immediately decided to analyze the sequence. For that, he needs to f
阅读全文
摘要:Jeff's got n cards, each card contains either digit 0, or digit 5. Jeff can choose several cards and put them in a line so that he gets some number. W
阅读全文
摘要:For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of
阅读全文
摘要:You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty substring of s and shift all its le
阅读全文
摘要:Vasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x1, x2, ..., xn. Vasya starts at the p
阅读全文