随笔分类 -  ACM

摘要:A.Fake NP 题意:给定两个整数L R,求[L,R]中公因子不为1的数的最大个数。 题解:显然要想数量尽量多,公因子就不会很大,所以枚举公因子(素数)即可,注意特判L==R的情况 代码: #include <cstdio> #include <cstring> #include <cstdli 阅读全文
posted @ 2019-03-15 20:04 WDZRMPCBIT 阅读(142) 评论(0) 推荐(0)
摘要:A.Group of Students 代码: #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> using namespace std; const in 阅读全文
posted @ 2019-03-12 20:36 WDZRMPCBIT 阅读(155) 评论(0) 推荐(0)
摘要:A.Kitchen Utensils 代码: #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> using namespace std; const int 阅读全文
posted @ 2019-03-06 16:51 WDZRMPCBIT 阅读(235) 评论(1) 推荐(0)
摘要:A.Snowball 代码: #include <cstdio> #include <climits> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> using namespace std 阅读全文
posted @ 2019-03-05 17:08 WDZRMPCBIT 阅读(243) 评论(0) 推荐(0)
摘要:A.Little C Loves 3 I 题意:给定一个整数N,问是否存在整数a b c使得a+b+c=N且a b c均不为3的倍数 题解:考虑到mod3的余数只有0 1 2,所以直接取1,1,N-2 或 1,2,N-3 或 2,2,N-4 代码: #include <cstdio> #includ 阅读全文
posted @ 2019-02-27 16:30 WDZRMPCBIT 阅读(277) 评论(0) 推荐(0)
摘要:A.Be Positive 题意:给定一个数列,求数列中一半及以上的数是正数、负数还是零。 代码: #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> usi 阅读全文
posted @ 2019-02-26 16:21 WDZRMPCBIT 阅读(417) 评论(0) 推荐(0)