daydayup牛
daydayup牛
全部文章
分类
题解(97)
归档
标签
去牛客网
登录
/
注册
daydayup牛的博客
全部文章
(共96篇)
题解 | #字符逆序#
#include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ for(auto it = str.rbegin(...
C++
脑筋急转弯
字符串
2022-03-21
0
266
题解 | #字符统计#
map也可以传比较函数进去,不过注意map比较的是key,不是比较的pair.还有ASII码要升序排但次数要降序排 #include <algorithm> #include <map> #include <vector> using namespace st...
C++
2022-03-20
0
318
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
排序mark一下 #include <algorithm> #include <vector> using namespace std; int main() { int n; while(cin>>n){ vector<...
C++
2022-03-20
0
262
题解 | #等差数列#
华为最短系列🤭 int main() { int n; while(std::cin>>n){ int temp = 2*n+3*(n-1)*n/2; std::cout<<temp; } }
C++
脑筋急转弯
2022-03-20
0
260
题解 | #自守数#
我的思路把他们都转化为字符串比较末尾长度,这个长度为想要判断的整数长度。 #include <algorithm> #include <cmath> using namespace std; int main() { int n; while(cin>...
C++
字符串
2022-03-20
0
286
题解 | #记票统计#
map和vector双管齐下 #include <algorithm> #include <map> #include <vector> using namespace std; int main() { int n1; while(cin&g...
C++
2022-03-20
0
364
题解 | #合法IP#
没有优化,但是AC100%题解有些通不过的,要注意每个是否有数字,或者像01这种不合法的 #include <algorithm> #include <sstream> #include <vector> using namespace std; int ma...
C++
2022-03-20
1
335
题解 | #扑克牌大小#
判断的情况挺多,写的有点乱 #include <algorithm> #include <sstream> #include <vector> #include <map> using namespace std; int main() { ...
C++
2022-03-20
0
281
题解 | #求最大连续bit数#
移位判断 #include <algorithm> using namespace std; int main() { int N; while(cin>>N){ int max = -1; int temp = 0; ...
C++
2022-03-20
0
248
题解 | #最长回文子串#
力扣第五题,动态规划一下,注意循环的方向,转化为的子问题应该是遍历过的,求最大长度应该判断是否大于当前最大。如果不是就不更新 #include <algorithm> #include <vector> using namespace std; int main() { ...
C++
2022-03-20
0
349
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页