合集-codeforces
摘要:A. Three Decks 满足;两个条件即可: 总和是3的倍数 c的值大于sum/3 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using
阅读全文
摘要:总体来说前三题比正常难度简单,后三题比正常难度难,且D是个交互。 所以就基本是手速场了,就看ABC过的速度。 A. Permutation Warm-Up 猜结论 观察样例guess一下,比如1234 就是反转序列,4321,再给每一位相减的和的绝对值/2+1. 点击查看代码 #include<bi
阅读全文
摘要:A. LRC and VIP 把最大值分一组,其他值分一组即可。 如果整个数组一样,那就是NO。 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; us
阅读全文
摘要:感觉前三题比较拼手速的一场 前两题wa了3发,扣分爆了 D题赛时的思路虽然对但有点复杂,不想自己写逆序对,遂从网上随便抄了个逆序对的板子。 赛时一直在wa,红温了两小时,第二天才发现是抄的板子有问题。 让ai写了个归并排序逆序对板子,一发过了 A. Dinner Time 可能有一点点难想的签 当数
阅读全文
摘要:A. Fashionable Array 暴力即可 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll = long long; usi
阅读全文
摘要:A. Square Year 判断一个数是不是平方数即可,赛时无脑写暴力了 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll = lo
阅读全文
摘要:手速场,切前四题后看表现分2000+且e过的人很少后就开摆了,其实应该能开e的,心态得改一下 A. Energy Crystals 感觉前四题最难的就是A了 找规律打表 点击查看代码 #include<bits/stdc++.h> #define int long long using namesp
阅读全文
摘要:感觉题目出的很不错的一场div3 f题赛时看成了,a数组是从1到n的排列,想了半天是什么妙妙题目 A. False Alarm 找第一个和最后一个,关着的门的位置 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace
阅读全文
摘要:A. Greedy Grid 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll = long long; using ull = un
阅读全文
摘要:A. Lever 只需要考虑每个 \(a_i~>~b_i\) 的数,计算差值累加即可 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll
阅读全文
摘要:C. Yet Another Array Problem 题意:大小为 \(n\) 的数组 \(a\),找到对于每一个 \(0<=r<k\),有多少个 \(a\) 的子集满足子集和 \(mod~~k~=r\) 纯背包问题,定义 \(f[i][j]\) 表示从前 \(i\) 个数中选,子集和为 \(j
阅读全文
摘要:A. Shift Sort 发现左移或右移等价于交换两个位置的数 所以答案即为前 \(cnt0\) 个数中有几个 \(1\) 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pai
阅读全文
摘要:A. Maximum Neighborhood 直接暴力构造出矩阵然后枚举答案,反正能过 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using
阅读全文
摘要:A. Shizuku Hoshikawa and Farm Legs 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll = long
阅读全文
摘要:A. Sleeping Through Classes 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll = long long; u
阅读全文
摘要:A. Little Fairy's Painting 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii = pair<int,int>; using ll = long long;
阅读全文
摘要:Problem E. TSP 问题 将所有点按照 \(x\) 分块,设块长为 B,则 \(x\) 在同一个块中的点,按照 \(y\) 排序,不在同一个块中的点,按照 \(x\) 排序 共有 \(n/B\) 个块,每一个块内对答案的贡献是:\(B+Y_{max}=2*10^5\),两个块之间对答案的共
阅读全文
摘要:A. Blackslex and Password 让位置 \(1,1+x,1+2x...,1+(k-1)x\) 用完前 \(k\) 个字母,则位置 \(1+kx\) 的字母必定要和前面那几个位置重复,所以答案就是 \(k*x+1\) B. Blackslex and Showering 可以先计算
阅读全文
摘要:A. New Year String 先判断有没有 2026 和 2025,如果有 2026 或没有 2025,则符合题意,直接输出 0 即可。 否则,此时字符串中一定有 2025,只需要一次修改把 5 改为 6 即可,答案为 1。 点击查看代码 #include<bits/stdc++.h> #d
阅读全文
摘要:D. Insolvable Disks Codeforces Global Round 31 (Div. 1 + Div. 2) https://codeforces.com/problemset/problem/2180/D 想了个非常复杂的 DP,写了一个多小时发现是错的 大致思路就是,从第一个
阅读全文
摘要:D. Find the Last Number Codeforces Round 1061 (Div. 2) https://codeforces.com/problemset/problem/2156/D 交互题,每次查询所有数某一位的值,看看这一位 0/1 出现的数量哪一个和实际数量不符,则答案
阅读全文
摘要:A. Lawn Mower 点击查看代码 #include<bits/stdc++.h> #define int long long #define endl '\n' using namespace std; using ll=long long; using pii=pair<int,int>;
阅读全文
摘要:A. Passing the Ball 纯模拟的,但好像是找第一个 L 的位置就行 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; using pii=pair<int,int>; using ll
阅读全文
摘要:B. Shortest Statement Ever rating:1800 tag:位运算,贪心,guess 感觉 \(x,y\) 是可以至少有一个不变的,枚举不变的那个,再尝试对另一个变化,去找最小幅度变大或变小的值 点击查看代码 #include<bits/stdc++.h> #define
阅读全文
摘要:2181 F. Fragmented Nim tag:博弈论 谁先给对手送去一个大于 \(1\) 的堆,谁就必输 判断 \(1\) 的个数就行 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; usin
阅读全文
摘要:2192 D. Cost of Tree tag: DFS,树形 DP 对以 \(u\) 为根的树来说,只有三种选择(下面的子树是指:以 \(u\) 的子节点 \(v\) 为根节点的子树): 不操作,这个答案是可以简单的预处理出来的 操作,且操作在某个子树内部:直接枚举是哪个子树被操作即可 操作,且
阅读全文

浙公网安备 33010602011771号