牛客971465536号
牛客971465536号
全部文章
分类
题解(52)
归档
标签
去牛客网
登录
/
注册
牛客971465536号的博客
全部文章
(共50篇)
题解 | #挑7#
while(line = readline()) { const num = parseInt(line); let count = 0; for (let i = 1; i <= num; i++) { if (isCludesSeven(i.toSt...
Javascript V8
2021-10-26
1
421
题解 | #计算字符串的距离#
//参考https://www.jianshu.com/p/90af98493661 while(str = readline()) { print(minDistance(str,readline())) // 2 } function minDistance(s1, s2) { ...
Javascript V8
2021-10-26
2
591
题解 | #截取字符串#
while(line = readline()) { const num = parseInt(readline()); print(line.substring(0, num)) }
Javascript V8
2021-10-26
0
404
题解 | #图片整理#
while(line = readline()) { const arr = line.split('').map(x => x.charCodeAt()); arr.sort((a, b) => a - b); print(arr.map(x => Str...
Javascript V8
2021-10-26
2
476
题解 | #迷宫问题#
//此为 DFS 深度搜索,搞了一下午,上网看了视频,还有广度搜素 while(line = readline()) { let [n, m] = line.split(' ').map(x => parseInt(x)); let test = Array(n).fill(0...
Javascript V8
2021-10-26
14
1187
题解 | #名字的漂亮度#
//逻辑比较烂,就是自己实现的字母统计完了(reduce比较好用一下就出来了),排序用26递减去乘 let arr = []; while(line = readline()) { arr.push(line); } const length = parseInt(arr[0]); con...
Javascript V8
2021-10-25
0
504
题解 | #统计字符#
while (input = readline()) { const arr = input.split(''); let eng = 0; let space = 0; // 32 let num = 0; //48-57 let other = 0; ...
Javascript V8
2021-10-25
0
441
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
const height = parseInt(readline()); let total = height; for (let i=1; i<=4; i++) { total += height/(2**i) * 2; } print(total); const height5 ...
Javascript V8
2021-10-25
0
388
题解 | #字符串加密#
//先去重获得秘钥然后进行二次去重获取字典,使用asc码差值获取字母位置 while(key = readline()) { const newStr = Array.from(new Set(key.split(''))).join('').toLowerCase(); cons...
Javascript V8
2021-10-25
0
440
题解 | #字符串排序#
while(line = readline()) { let length = line.length; let pointer = 97; let codeArr = []; let otherArr = []; for (let i = 0; i <...
Javascript V8
2021-10-25
0
552
首页
上一页
1
2
3
4
5
下一页
末页