Codeforces Good bye 2020 A-F题解题目链接:https://codeforces.com/contest/1466A.Bovine Dilemma题意:给你一些x轴上的点,让你求所给的点和(0, 1)点围成的不同的非零面积的数量。 思路:直接模拟即可。#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inlin
Elevator 怎么今天写啥题都不会写啊, 我是傻了吗。。 把电梯里面四个人的目标点当作状态, 然后暴力转移。
转载
2019-03-07 20:43:00
37阅读
2评论
A - Split it!检查 \(k=0\) 或者长 \(k\) 的前缀和长 \(k\) 的后缀的反串是否相同。注意如果 \(2k=n\) 要特判。复杂度 \(O(n+k)\)。B - Max and Mex模拟一下过程就会发现:要么 \(\max\) 和 \(\operatorname{max}\) 永远不会变,要么就会一直加 \(1\)。所以答案只有可能是 \(n,n+1,n+k\) 中的一
转载
2021-03-11 08:31:03
313阅读
2评论
比赛链接:http://codeforces.com/contest/854A. Fraction解法:按照题意模拟即可。#include <bits/stdc++.h>using namespace std;int main(){ int n; cin >> n; for(int i=n/2; i>=1; i--){ if(__gcd
原创
2022-04-19 10:20:25
32阅读
A题 关注到本题的数据量不大但是数据很大,可以使用暴力+哈希的方法 将关闭的餐厅放到map遍历 #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<map> #
转载
2020-01-20 11:42:00
91阅读
A题 只需要找到A中后面跟的最长的p串是几个即可 #include<iostream> #include<cstring> #include<string> #include<map> #include<vector> #include<cstdio> using namespace std; in
转载
2020-01-12 21:28:00
90阅读
Codeforces 题解
转载
2021-03-10 14:52:00
106阅读
2评论
A题 对于两个分别求解到每一位的时间,看看是否有相等的 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=2e5+10; const in
转载
2021-03-18 10:46:00
91阅读
2评论
A题 先除再计算即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; typedef pair<int,int> plll; const int N=3e5+1
转载
2020-12-25 22:16:00
110阅读
2评论
A题 枚举每一位,如果是偶数就加上i #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=2e5+10; int main(){ ios::
转载
2020-12-24 19:13:00
49阅读
2评论
A题 循环构造bac即可,因为题目是小于等于,我看成了等于所以构造的复杂了点 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int main(){ ios::sync_with_stdio(false); int t
转载
2021-01-19 10:50:00
70阅读
2评论
A题 排序输出答案即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=4e5+10; const int inf=1e9; int a
转载
2020-12-22 18:47:00
59阅读
2评论
A题 通过平移线段可以发现其实就是缺少的那一块的大小 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=5e5+10; int main(
转载
2020-12-21 22:21:00
64阅读
2评论
A题 贪心思路,注意到他们每个是每个排列进行比较,因此只要判断两个字符串对应位置的大小,谁多就谁赢 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const
转载
2020-12-20 20:12:00
66阅读
2评论
A题: 我们发现如果任意两个奇偶性不同都不行,因为只要奇偶相同,都能够通过加2操作得到 #include<iostream> #include<queue> #include<map> #include<vector> #include<cstdio> #include<algorithm> #in
转载
2020-03-14 08:13:00
80阅读
2评论
A题 本题根据题意模拟能解,不排除更好的做法 #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<vector> #include<cstring> using namespace std;
转载
2020-02-02 12:04:00
72阅读
2评论
A题 做法很明显,就是隔壁连续1和连续2取min,虽然写的比较复杂 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+10; int a[N]; queue<int> q1,q2; i
转载
2020-12-16 23:38:00
56阅读
2评论
1.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Nauuo is a girl who loves playing cards.
One day she was pl...
原创
2023-02-08 09:19:15
58阅读
A题 本题只需要对e,f进行大小比较,决定先买哪个即可,因为jacket对于每类都需要一个,所以以jacket为指标。 #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm>
转载
2020-01-18 22:23:00
92阅读
A题 枚举记录 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=2e6+10; const int mod=1e9+7; const i
转载
2021-01-27 18:52:00
71阅读
2评论