2018年7月31日

摘要: Problem Description Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. 阅读全文
posted @ 2018-07-31 04:14 Lis~ 阅读(196) 评论(0) 推荐(0) 编辑
 
摘要: 给定n个数A1...An,小Ho想了解AL..AR中有多少对元素值相同。小Ho把这个数目定义为区间[L,R]的价值,用v[L,R]表示。 例如1 1 1 2 2这五个数所组成的区间的价值为4。 现在小Ho想知道在所有的的v[L,R](1 <= L <= R <= n)中,第k小的值是多少。 Inpu 阅读全文
posted @ 2018-07-31 04:00 Lis~ 阅读(447) 评论(2) 推荐(0) 编辑
 
摘要: An array of size n ≤ 10 6 is given to you. There is a sliding window of size kwhich is moving from the very left of the array to the very right. You c 阅读全文
posted @ 2018-07-31 03:43 Lis~ 阅读(554) 评论(0) 推荐(0) 编辑
 

2018年7月30日

摘要: 题目描述 A ternary string is a sequence of digits, where each digit is either 0, 1, or 2. Chiaki has a ternary string s which can self-reproduce. Every se 阅读全文
posted @ 2018-07-30 10:38 Lis~ 阅读(405) 评论(0) 推荐(0) 编辑
 

2018年7月29日

摘要: Primitive Roots We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (x i mod p) | 1 <= i <= p-1 } is equ 阅读全文
posted @ 2018-07-29 21:13 Lis~ 阅读(290) 评论(0) 推荐(0) 编辑
 
摘要: Relatives Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if 阅读全文
posted @ 2018-07-29 20:53 Lis~ 阅读(149) 评论(0) 推荐(0) 编辑
 
摘要: 讲解了欧拉函数和一些模板的使用 https://www.cnblogs.com/PJQOOO/p/3875545.html 欧拉定理: 如果a与n互质的话,那就有a的n的欧拉数次方取余n等于1 缩系:就是由一个n,(1,n-1)内的所有和n互质的数组成的组合 原根:如果一个数的(0,m欧拉数-1)内 阅读全文
posted @ 2018-07-29 20:45 Lis~ 阅读(306) 评论(0) 推荐(0) 编辑
 

2018年7月28日

摘要: 链接:https://www.nowcoder.com/acm/contest/142/F来源:牛客网 题目描述 There's a beautiful garden whose size is n x m in Chiaki's house. The garden can be partition 阅读全文
posted @ 2018-07-28 19:53 Lis~ 阅读(291) 评论(0) 推荐(0) 编辑
 
摘要: 链接:https://www.nowcoder.com/acm/contest/142/G来源:牛客网 The mode of an integer sequence is the value that appears most often. Chiaki has n integers a1,a2, 阅读全文
posted @ 2018-07-28 17:16 Lis~ 阅读(620) 评论(0) 推荐(0) 编辑
 
摘要: 链接:https://www.nowcoder.com/acm/contest/156/C来源:牛客网 托米完成了1317的上一个任务,十分高兴,可是考验还没有结束 说话间1317给了托米 n 个自然数 a1... an, 托米可以选出一些带回家,但是他选出的数需要满足一些条件 设托米选出来了k 个 阅读全文
posted @ 2018-07-28 01:28 Lis~ 阅读(351) 评论(0) 推荐(0) 编辑