键盘侠牧师
你的脸上风淡云轻,谁也不知道你的牙咬得有多紧。你走路带着风,谁也不知道你膝盖上仍有曾摔过的伤的淤青。你笑得没心没肺,没人知道你哭起来只能无声落泪。要让人觉得毫不费力,只能背后极其努力。我们没有改变不了的未来,只有不想改变的过去。
摘要: 题目链接:https://www.acwing.com/problem/content/206/ 给定2n个整数a1,a2,…,ana1,a2,…,an和m1,m2,…,mn,求一个最小的非负整数x,满足∀i∈[1,n],x≡mi(mod ai)∀i∈[1,n],x≡mi(mod ai)。 输入格式 阅读全文
posted @ 2019-09-04 14:39 键盘侠牧师 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 原题链接 :https://www.acwing.com/problem/content/893/ 给定nn堆石子,两位玩家轮流操作,每次操作可以从任意一堆石子中拿走任意数量的石子(可以拿完,但不能不拿),最后无法进行操作的人视为失败。 问如果两人都采用最优策略,先手是否必胜。 输入格式 第一行包含 阅读全文
posted @ 2019-09-01 11:23 键盘侠牧师 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 今天困得不行,就看了个小算法st,其实和线段树的作用一样, 不过这个算法没有用到数据结构,使用二进制优化的 是O(log(n)n)的时间预处理,然后以O(1)的时间返回(l,r)上的最大或最小 st的题目: P2880 [USACO07JAN]平衡的阵容Balanced Lineup 题解 P225 阅读全文
posted @ 2019-08-29 11:12 键盘侠牧师 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 小A最近开始研究数论题了,这一次他随手写出来一个式子, 但是他发现他并不太会计算这个式子,你可以告诉他这个结果吗,答案可能会比较大,请模上1000000007。 输入描述: 输出描述: 示例1 输入 复制 2 2 输出 复制 7 示例1 输入 复制 2 2 输出 复制 7 输入 复制 2 2 输入 阅读全文
posted @ 2019-08-24 13:37 键盘侠牧师 阅读(208) 评论(0) 推荐(0) 编辑
摘要: The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1, 阅读全文
posted @ 2019-08-22 16:44 键盘侠牧师 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Fernando won a compass for his birthday, and now his favorite hobby is drawing stars: first, he marks N points on a circumference, dividing it into N e 阅读全文
posted @ 2019-08-22 15:34 键盘侠牧师 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime 阅读全文
posted @ 2019-08-22 14:28 键盘侠牧师 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://codeforces.com/problemset/problem/320/B 之前自己做的时候一直读不懂题意,看了大佬的博客才知道是用dfs写,一道暴力搜索大水题https://www.cnblogs.com/windysai/p/3531473.html 题目意思:有两种 阅读全文
posted @ 2019-08-22 11:23 键盘侠牧师 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值。 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5=0+1+0+3+3=7。 输入格式 输入仅一行,包含两个 阅读全文
posted @ 2019-08-21 00:23 键盘侠牧师 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; string s; int main() { cin>>s; int b; cin>>b; for(int i=0;i<s.length();i++) { s[i]=s[i]-'0'; } long long ans=0; for(int i=0;i<s.length();i++) { ans=(ans*10+s[i 阅读全文
posted @ 2019-08-19 19:07 键盘侠牧师 阅读(95) 评论(0) 推荐(0) 编辑