![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
校赛
weixin_43331783
/p/px5xQRGVPD/
展开
-
选拔赛A题“一个部族,一个民族,一个弗雷尔卓德。”
这题就是一个素数筛再加上一个线段树。首先数据素数筛将每个最小素因子的倍数标记最小素因子(简单来讲就是把每个数最小素因子标记出来)然后再遍历每个数。线段树标记1-x-1中最小素因子小于当前最小素因子的数量。最后数组里就是1-x-1中符合标准的数字,最后输入再查询即可。这道题关键在于预先处理,处理好了这道题就很简单了。以下为A代码 #include<iostream> #include...原创 2019-03-08 20:02:10 · 116 阅读 · 0 评论 -
选拔赛B题可怜的ljb
Sample Input 1 2 5 5 4 2 1 3 2 5 4 1 3 4 1 2 3 4 1 2 4 3 Sample Output 1 2 1 Hint 第一组样例解释:有两对同学的相对顺序改变了,分别是:(5,2),(4,2)。因为第一轮5排在2前面,但是第二轮2排在5前面,(4,2)同理,故答案是2.第二组样例解释:组数据有一对同学的相对顺序改变了,分别是:(3,4)。因为...原创 2019-03-08 20:24:53 · 109 阅读 · 0 评论 -
选拔赛c题武器大师的宝贝
#include<iostream> #include<stdio.h> #include<algorithm> using namespace std; typedef long long ll; ll getshu(ll a,ll c) { while(1) {if(c%a==0) {return a;break;} ...原创 2019-03-09 10:08:21 · 3721 阅读 · 0 评论 -
选拔赛G题寻宝
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; typedef long long ffi; ffi treasure[105][15]; int main() { int n,k; scanf("...原创 2019-03-09 10:12:32 · 149 阅读 · 0 评论 -
选拔赛D题点进来吧这里有你想要的
#include<iostream> #include<cmath> #include<stdio.h> using namespace std; typedef long long ffi; const int maxn=2e5+5; const int mod=1e8+7; int n,m; int dp[maxn]; int main() { in...原创 2019-03-09 10:14:08 · 87 阅读 · 0 评论 -
选拔赛i题小明买年糕
#include<iostream> #include<stdio.h> #include<cmath> #include<cstring> using namespace std; const int inf=0x3f3f3f3f; const int maxn=200005; typedef long long ffi; int n,m; ffi...原创 2019-03-09 10:20:01 · 91 阅读 · 0 评论 -
选拔赛j题哭泣的阿木木
#include<iostream> #include<stdio.h> #include<cstring> #include<algorithm> using namespace std; int n,m; char c[10]; const long long maxn=300010; typedef long long ffi; struct ...原创 2019-03-09 10:27:54 · 88 阅读 · 0 评论