摘要: Description 今天的数学课上,Crash小朋友学习了最小公倍数(Least Common Multiple)。对于两个正整数a和b,LCM(a, b)表示能同时被a和b整除的最小正整数。例如,LCM(6, 8) = 24。回到家后,Crash还在想着课上学的东西,为了研究最小公倍数,他画了 阅读全文
posted @ 2017-02-23 23:27 Heilce 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th 阅读全文
posted @ 2017-02-23 17:00 Heilce 阅读(323) 评论(0) 推荐(0) 编辑
摘要: Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity — origami, but remembered the puzzle that s 阅读全文
posted @ 2017-02-22 14:27 Heilce 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Description 有一张N×m的数表,其第i行第j列(1 < =i < =礼,1 < =j < =m)的数值为 能同时整除i和j的所有自然数之和。给定a,计算数表中不大于a的数之和。 有一张N×m的数表,其第i行第j列(1 < =i < =礼,1 < =j < =m)的数值为 能同时整除i和j 阅读全文
posted @ 2017-02-22 09:36 Heilce 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 因为我没有BZOJ的权限号,所以我的代码只是过了样例,所以具体的细节我也不知道过没有,所以看我博客的同学要是不麻烦的话可以交一下我的代码。。 Description 神犇YY虐完数论后给傻×kAc出了一题 给定N, M,求1<=x<=N, 1<=y<=M且gcd(x, y)为质数的(x, y)有多少 阅读全文
posted @ 2017-02-21 16:12 Heilce 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 题意 输入a,找到满足n!>a^n 最小的n。 数据 第一行T(1 <= T <= 1e5),表示测试样例数.(2 <= a <= 1e6)。 输入 3 2 3 4 输出 4 7 9 这个东西一看就知道是二分求解的,但是我们还是不知道怎么求的,我们可以吧他们取对数然后我们很惊奇的发现原来真的是取对数 阅读全文
posted @ 2017-02-21 14:53 Heilce 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一个字符串,包含'(',')','?'三种字符,将一个'?'变为左括号需要花费ai,将一个'?'变成右括号需要花费bi 求将字符串变为合法括号序列的最小代价和此时的合法括号序列,无解输出'-1' 数据 字符串长度为偶数,长度 <= 5*10^4, 1 <= ai,bi <= 10^6 输入 阅读全文
posted @ 2017-02-21 10:02 Heilce 阅读(171) 评论(0) 推荐(0) 编辑
摘要: VLATTICE - Visible Lattice Points Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are v 阅读全文
posted @ 2017-02-20 23:19 Heilce 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 给出一个正奇数K,两个正整数low,high。 有多少整数属于[low, high],且包含K个因子。 数据 C(0 < C < 1e5),测试样例数。 (1 < K < 10000, 0 < low <= high < 1e10)。 输入 3 3 2 49 9 1 100 5 55 235 输出 阅读全文
posted @ 2017-02-20 16:27 Heilce 阅读(188) 评论(0) 推荐(0) 编辑
摘要: void Init() { memset(vis,0,sizeof(vis)); mu[1] = 1; cnt = 0; for(int i=2; i<N; i++) { if(!vis[i]) { prime[cnt++] = i; mu[i] = -1; }... 阅读全文
posted @ 2017-02-20 15:14 Heilce 阅读(158) 评论(0) 推荐(0) 编辑