首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
课程
专栏·文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
深海爱人情太深,许谁ひ倾
获赞
28
粉丝
1
关注
1
看过 TA
10
男
门头沟学院
2026
web前端
IP属地:黑龙江
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑深海爱人情太深,许谁ひ倾吗?
发布(27)
刷题
深海爱人情太深,许谁ひ倾
2023-07-03 13:49
门头沟学院 自动化类
题解 | #斐波那契数列#
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @return int整型 */ function Fibonacci( n ) { // write code here let a=[]; if(n==1||n==2){ return 1; } a.push(1); a.push(1); for(let i=2;i<n;i++){ a.push(a[i-1]+a[i-2]); } re...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-08 14:22
门头沟学院 自动化类
题解 | #寻找峰值#
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型一维数组 * @param numsLen int nums数组长度 * @return int整型 */ int findPeakElement(int* nums, int numsLen ) { // write code here if(numsLen==1){ return 0; } if(numsLen==2){ if(nums[0]<nums[1]){ ...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-08 12:28
门头沟学院 自动化类
题解 | #二维数组中的查找#
class Solution { public: bool Find(int target, vector<vector<int> > array) { if (array.size() == 0) return false; int r = array.size(); int l = array[0].size(); int left = 0, down = r - 1; while (left < l && down >= 0) { i...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-08 11:18
门头沟学院 自动化类
题解 | #二分查找-I#
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型一维数组 * @param numsLen int nums数组长度 * @param target int整型 * @return int整型 */ int search(int* nums, int numsLen, int target ) { // write code here int left=0,right=numsLen-1; while(left<=right){ int mid...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-07 13:27
门头沟学院 自动化类
题解 | #删除有序链表中重复的元素-II#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 * @return ListNode类 */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> struct ListNode* deleteDuplicates(struct ListNo...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-07 13:01
门头沟学院 自动化类
题解 | #删除有序链表中重复的元素-I#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 * @return ListNode类 */ struct ListNode* deleteDuplicates(struct ListNode* head ) { // write code here struct ListNode *p=head; while (p-...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-07 12:57
门头沟学院 自动化类
题解 | #链表的奇偶重排#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 * @return ListNode类 */ #include <stdbool.h> struct ListNode* oddEvenList(struct ListNode* head ) { // write code here if(head==NULL||h...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-07 12:44
门头沟学院 自动化类
题解 | #判断一个链表是否为回文结构#
本代码采用的思路是:利用头插法反转单链表,然后循环比较即可。 /** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param head ListNode类 the head * @return bool布尔型 */ #include <stdlib.h> bool isPail(struct ListNode* head ) { // write code here struct ListNode *newHead=NULL,*q=head,*...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-07 12:32
门头沟学院 自动化类
题解 | #单链表的排序#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param head ListNode类 the head node * @return ListNode类 */ 本代码使用归并的思想,先使用快慢指针找到单链表的中点,将链表切割为两部分,将两个有序的子链表合并为一个有序的链表 struct ListNode* sortInList(struct ListNode* head ) { // write code here //当前链表为空或者只有一个结点,无需...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2023-03-04 15:20
门头沟学院 自动化类
题解 | #两个链表的第一个公共结点#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param pHead1 ListNode类 * @param pHead2 ListNode类 * @return ListNode类 */ #include <stdlib.h> struct ListNode* FindFirstCommonNode(struct ListNode* pHead1, struct ListNode* pHead2 ) { // write code her...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2022-06-21 18:35
门头沟学院 自动化类
题解 | #坐标移动#
这道题唯一可能存在的难点就是如何判断是不是合法的坐标 let list=['A','D','W','S'] console.log(readline().split(';').reduce((pre,cur)=>{ if(cur.length==2&&list.indexOf(cur[0])>=0&&!isNaN(cur[1])){ return move(pre,cur[0],parseInt(cur[1])) }else if(cur.length==3&&list.indexOf(cur[0])&...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2022-05-27 10:40
门头沟学院 自动化类
题解 | #求解立方根#
看了题解实操一波 let A=readline() let B=readline() let res=[] for(let i=0;i<=A.length;i++){ //此处是为了初始化一个二维数组,"','+B"是为了多创建一列 res[i]=Array.from(","+B).map((v,j)=>i==0?j:0) res[i][0]=i } // console.log(res) for(let i=1;i<res.length;i++){ for(let j=1;j<res[i].length;j++){ if(...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2022-05-26 23:20
门头沟学院 自动化类
题解 | #求解立方根#
本题使用暴力去解决,每隔0.1去加,挨个试,可能存在的问题的地方有两个,一个是可能会有两个接近的数,需要二次判断,还有就是A题是可能想不起来toFixed(1)去保留一位小数,所以只能转换为字符串,使用slice去截取函数,哈哈哈哈哈哈 let num=parseFloat(readline()) let a=0 let cur=num<0?num*(-1):num while(a*a*a<cur){ a+=0.1 } let d=a-0.1 if(cur-d*d*d<a*a*a-cur){ a=d } let b=a+'' let c=b.slice(0,b...
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2022-05-26 22:18
门头沟学院 自动化类
2022-05-26
在牛客打卡9天,今天学习:刷题 2 道/代码提交 22 次
每日监督打卡
0
点赞
评论
收藏
转发
深海爱人情太深,许谁ひ倾
2022-05-26 22:16
门头沟学院 自动化类
题解 | #密码截取#
这道题的主要分为两种情况,对于每个元素,分是否作为中心点考虑,如果是中心点,let l=index-1,let r=index+1,否则的话,let l=index,let r=index+1 let input=readline() let arr=Array.from(input) let res=[] for(let i=0;i<arr.length;i++){ let a=d1(i,arr) let b=d2(i,arr) // console.log(a,b) res[i]=Math.max(a,b) } console.log(Math.max...
0
点赞
评论
收藏
转发
1
2
工具箱
TA的圈子
暂未加入圈子
TA的圈子
TA的笔记
暂无笔记
TA的笔记
登录
0
天
已登录
0
天
连续登录
0
人
今日访客
牛客网
牛客企业服务