摘要:
一直没补,把之前的粘贴过来 E An Interesting Sequence 为使数组和小,并且gcd=1,我们添加2,3,,找到第一个不整除k的质数,然后后面放2,3,判断先放2还是3 J A Game about Increasing Sequences Alice and Bob like 阅读全文
摘要:
可持久化trie树 最大异或和 #include <iostream> using namespace std; const int N = 600010, M = N * 25; int n, m; // 序列初始长度、操作个数 int s[N]; // 原序列的异或前缀和 int tr[M][2 阅读全文
摘要:
单点修改,区间查询 #include<bits/stdc++.h> using namespace std; #define int long long #define lowbit(x) (x&(-x)) const int N=5e5+10; int a[N],s[N]; int n,m; vo 阅读全文
摘要:
简直噩梦,几道板子题我都debug好久 单点修改,区间查询 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; typedef long long int LL; struct tree{ LL left,right,su 阅读全文
摘要:
Cut Ribbon #include<bits/stdc++.h> using namespace std; const int N=4e3+10; int dp[N],v[4]; //dp[i]表示长度 为i最多能够分成几段 int main(){ int n; cin>>n>>v[0]>>v[ 阅读全文
摘要:
A. Password 计算出现的数,从这些数中任意选两不同的,每种组合6种方案,计算输出即可 #include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; for 阅读全文
摘要:
A. Number Replacement 模拟 易发现一个数字只能对应一个字母,mp统计判断一下即可 #include<bits/stdc++.h> using namespace std; const int N=2e5+10; int a[N]; map<int,char> mp; int m 阅读全文
摘要:
A. Maxmina 显然结果全为0时,结果为NO,若有1,我们通过操作1使长度变为k,里面包含至少1,通过操作2,结果即为YES 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N=2e5+10; 4 int a[N]; 5 阅读全文