摘要:
A - Candy Button #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; using vi = vector<int>; using pii = pair<in 阅读全文
摘要:
A - x to y 可以把与操作理解为减,把或操作理解为加。先减掉多的,再加上少的。因此至多两次即可。 #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; using u 阅读全文
摘要:
A. Two Screens 难点是读题,找到最长公共前缀即可。 #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; #define int i64 using vi = 阅读全文
摘要:
A - Seats #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; #define int long long using vi = vector<int>; usin 阅读全文
摘要:
\(cnt\)的取值种类数不超过\(\sqrt n\)。因此我们可以枚举\(cnt\) 然后贪心选最大的值。 #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; #defi 阅读全文
摘要:
A. (-1,1)-Sumplete 首先只取\(-1\),这样的话选1和不选-1产生的贡献就是都是 +1。 枚举每一行,然后贪心选择需求最大的若干列。 #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using 阅读全文