摘要: Anton has a positive integer n, however, it quite looks like a mess, so he wants to make it beautiful after k swaps of digits.Let the decimal represen 阅读全文
posted @ 2018-08-07 20:29 行远山 阅读(293) 评论(0) 推荐(0) 编辑
摘要: Description 已知一个长度为 n 的整数数列 a[1],a[2],…,a[n] ,给定查询参数 l、r ,问在 [l,r] 区间内,有多少连续子 序列满足异或和等于 k 。 也就是说,对于所有的 x,y (l≤x≤y≤r),能够满足a[x]^a[x+1]^…^a[y]=k的x,y有多少组。 阅读全文
posted @ 2018-08-07 20:24 行远山 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/163/F来源:牛客网 时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述 There is a matrix A th 阅读全文
posted @ 2018-08-06 19:13 行远山 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 欧拉函数 性质: 设φ(x)表示欧拉函数,其有如下性质: 1.对素数p,φ(p)=p-1. 2.设p,q为不同的素数,φ(pq)=(p-1)(q-1). 3.欧拉函数不是完全积性函数,φ(nm)=φ(n)*φ(m),当且仅当gcd(n,m)=1时成立 4.对于任何一个正整数的素数幂分解,N=p1^q 阅读全文
posted @ 2018-08-02 23:43 行远山 阅读(1087) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/143/E来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他语言2秒 空间限 阅读全文
posted @ 2018-08-02 20:45 行远山 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Problem Description There are n apples on a tree, numbered from 1 to n.Count the number of ways to pick at most m apples. Input The first line of the 阅读全文
posted @ 2018-08-02 11:49 行远山 阅读(395) 评论(2) 推荐(0) 编辑
摘要: #include #define maxn 100005 using namespace std; typedef struct Trie_node { int cnt; struct Trie_node *next[26]; bool exist; }Trie_node,*Trie; Trie_node *createTrienode() { Trie_nod... 阅读全文
posted @ 2018-07-27 11:56 行远山 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/141/A来源:牛客网 Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding, Math 阅读全文
posted @ 2018-07-26 20:36 行远山 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是 阅读全文
posted @ 2018-07-26 20:00 行远山 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Problem Description In a galaxy far, far away, there are two integer sequence a and b of length n.b is a static permutation of 1 to n. Initially a is 阅读全文
posted @ 2018-07-26 10:33 行远山 阅读(309) 评论(0) 推荐(0) 编辑