B.rmtcg
原题链接:rmtcg - 核桃OJ
代码这不就来了吗?
#include <bits/stdc++.h>
using namespace std;
const int N = 300005, V = 1000005, pi = 79498 + 5; //N是输入的空间大小,V是值域,pi是1~1e6的质数个数
unsigned bit_width(unsigned x){
return x == 0 ? 0 : floor(log2(x)) + 1;
}
int n, m, a[N], st[21][N];
vector<int> d[V];
vector<int> pos[pi];
vector<int> primes;
vector<int> id;
int l, r, k;
int main(){
freopen("rmtcg.in", "r", stdin);
freopen("rmtcg.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for (int i = 0; i < n; i++){
cin >> a[i];
}
int o = bit_width(n); //获取n的二进制位数
for (int i = 0; i < n; i++){
st[0][i] = a[i];
}
for (int i = 1; i < o; i++){

最低0.47元/天 解锁文章
237

被折叠的 条评论
为什么被折叠?



