求职找工作ing
求职找工作ing
全部文章
分类
题解(14)
归档
标签
去牛客网
登录
/
注册
guanyubo
你间歇性的努力和蒙混过日子,都是对之前努力的清零!
全部文章
(共15篇)
HJ61 放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf?tpId=37&tqId=21284&ru=/exam/oj 如果 n > m,将 n 设置为 m。 初始化一个数组 dp,其中 dp[i][...
2024-03-19
0
52
题解 | #最长回文子串#
#include <bits/stdc++.h> using namespace std; int main(){ string str; while(getline(cin,str)){ int len=str.size(); int ...
C++
2022-05-13
0
194
题解 | #整型数组合并#
思路: set容器的性质: 1、对加入容器的元素自动进行升序排序。 2、元素在容器中是唯一的。 代码: #include<bits/stdc++.h> using namespace std; int main(){ set<int> arr; int a,...
C++
2022-04-26
0
154
题解 | #尼科彻斯定理#
思路: 代码: #include<bits/stdc++.h> using namespace std; int main(){ int n,a1,res; string str; while (cin >> n){ str = "...
C++
2022-04-26
0
237
题解 | #计算日期到天数转换#
判断闰年 https://www.zhihu.com/question/25388501 #include<bits/stdc++.h> using namespace std; // 判断是否是闰年,闰年2月29天,平年2月28天 int is_leap_year(int year)...
C++
2022-04-26
0
249
题解 | #查找输入整数二进制中1的个数#
#include<bits/stdc++.h> using namespace std; int main(){ int num, count; while(cin>>num){ count = 0; while(num!=0...
C++
2022-04-26
0
237
题解 | #输出单向链表中倒数第k个结点#
思路: 双指针法:两个指针res和real同时指向链表的头结点head(空头结点),然后让real指针向后移动k的节点,然后res和real节点开始同步向后移动,当real节点指向链表的尾节点的后一个位置即空节点的时候,此时res指针所指的节点即为倒数第k的节点。 代码: #include<b...
C++
2022-04-25
0
267
题解 | #统计每个月兔子的总数#
思路: 代码: #include<bits/stdc++.h> using namespace std; int main(){ int a, b1, b2, month; while(cin>>month){ a = 0; ...
C++
2022-04-25
0
191
题解 | #蛇形矩阵#
思路: 1 3 6 10 2 5 9 4 8 7 第一行[1 3 6 10] 第二行是 去掉第一行的第一列,然后将后面的[3 6 10]分别减1得到的。 代码: #include<bits/stdc++.h> using namespace std; int main(){ in...
C++
2022-04-25
3
202
题解 | #图片整理#
思路: 定义string字符串接收输入的字符串,将string字符串中的每一个字符逐个的加入到vector数组中,然后调用sort排序算法对vector数组进行排序。 代码: #include<bits/stdc++.h> using namespace std; // 自定义vect...
C++
2022-04-25
0
154
首页
上一页
1
2
下一页
末页