随笔分类 -  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 阅读全文
posted @ 2019-01-17 16:30 NKDEWSM 阅读(162) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#pragma GCC optimize(2) using na... 阅读全文
posted @ 2019-01-16 10:40 NKDEWSM 阅读(354) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#pragma GCC optimize(2) using na... 阅读全文
posted @ 2019-01-16 10:38 NKDEWSM 阅读(251) 评论(0) 推荐(0) 编辑
摘要:前后扫一遍; 阅读全文
posted @ 2019-01-16 10:37 NKDEWSM 阅读(258) 评论(0) 推荐(0) 编辑
摘要:题意翻译 题意简述 给出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 阅读全文
posted @ 2019-01-16 10:35 NKDEWSM 阅读(486) 评论(0) 推荐(0) 编辑
摘要:每次交换:逆序对的数量+1或者-1; 假设最后逆序对数量为 sum; ①x+y=3n; ②x-y=sum; -> 3n+sum为偶数; 所以 n 和 sum 必须奇偶一样; 阅读全文
posted @ 2019-01-15 18:50 NKDEWSM 阅读(248) 评论(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 阅读(311) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-01-03 17:02 NKDEWSM 阅读(321) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-01-03 16:56 NKDEWSM 阅读(677) 评论(0) 推荐(0) 编辑
摘要:DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value wc. For each special string 阅读全文
posted @ 2019-01-03 16:49 NKDEWSM 阅读(232) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-01-03 16:48 NKDEWSM 阅读(209) 评论(0) 推荐(0) 编辑
摘要: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' 阅读全文
posted @ 2018-12-30 19:14 NKDEWSM 阅读(199) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-30 19:08 NKDEWSM 阅读(146) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-30 19:06 NKDEWSM 阅读(225) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-16 17:22 NKDEWSM 阅读(179) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-16 17:10 NKDEWSM 阅读(240) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-16 17:08 NKDEWSM 阅读(198) 评论(0) 推荐(0) 编辑