摘要: 数据范围很小,搜索即可 #include<bits/stdc++.h> #define sc(n) scanf("%d",&n) #define ll long long #define db double #define P pair<int,int> using namespace std; i 阅读全文
posted @ 2020-04-05 12:05 洛绫璃 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 根据题意模拟 #include <bits/stdc++.h> #define ull unsigned long long #define P pair<int, int> #define sc(n) scanf("%d", &n) using namespace std; const int p 阅读全文
posted @ 2020-04-05 11:58 洛绫璃 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 水题 #include<bits/stdc++.h> using namespace std; int a, b, k; int main(){ cin >> a >> b >> k; while(k--) if(a>b) a /= 2; else b /= 2; cout << max(a,b) 阅读全文
posted @ 2020-04-05 11:54 洛绫璃 阅读(123) 评论(0) 推荐(0) 编辑
摘要: A(题解看注释) #include <bits/stdc++.h> #define P pair<int, int> using namespace std; struct mp { int p[7][7]; bool friend operator <(const mp &a, const mp 阅读全文
posted @ 2020-04-02 17:09 洛绫璃 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 以下说到的 位数 均指二进制位数 按位讨论每对(a[i], a[j])对答案第i位的贡献 log2(1e7) 上取整 24 位 影响第i位的,只有 0~i 位 当a[i] 位为 1 时,能对 答案第i位贡献 1的 就是 a[j](第i位位0 且 0~(i-1)位与a[i]相加不进位)或者 (第i位为 阅读全文
posted @ 2020-03-31 16:55 洛绫璃 阅读(134) 评论(0) 推荐(0) 编辑
摘要: //很好玩的一道题 #include <bits/stdc++.h> #define P pair<int, int> #define ll long long using namespace std; const int maxn = 4e4 + 5; int n, m, k; ll ans; i 阅读全文
posted @ 2020-03-31 13:58 洛绫璃 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 拉两次车,第一次假设最长回文串就在两边 第二次,先使得左右两边判回文,在将剩下的串 在manachar一遍, 比较两种情况取最大值,然后就是输出问题见代码 #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; 阅读全文
posted @ 2020-03-31 00:07 洛绫璃 阅读(158) 评论(0) 推荐(0) 编辑
摘要: A #include <bits/stdc++.h> using namespace std; int n, a, b, c; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%d%d%d", &a, &b, & 阅读全文
posted @ 2020-03-29 22:55 洛绫璃 阅读(308) 评论(0) 推荐(1) 编辑
摘要: A #include <bits/stdc++.h> using namespace std; int x, y, d; int main() { scanf("%d%d%d", &x, &y, &d); x -= d << 1; y -= d << 1; if (x <= 0 || y <= 0) 阅读全文
posted @ 2020-03-26 16:14 洛绫璃 阅读(256) 评论(1) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/4743/C来源:牛客网 题目描述: 牛牛有x件材料a和y件材料b,用2件材料a和3件材料b可以合成一件装备,用4件材料a和1件材料b也可以合成一件装备。牛牛想要最大化合成的装备的数量,于是牛牛找来了你帮忙。 输入描述: 阅读全文
posted @ 2020-03-14 19:39 洛绫璃 阅读(223) 评论(0) 推荐(0) 编辑