牛客971465536号
牛客971465536号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客971465536号的博客
全部文章
/ 题解
(共32篇)
题解 | #找出字符串中第一个只出现一次的字符#
while(line = readline()) { const arr = line.split(''); let result = arr.reduce((temp, data) => { temp[data] = temp[data] ? temp[da...
Javascript V8
2021-10-27
0
418
题解 | #高精度整数加法#
//数字超过了NUMBER.MAX_SAFE_INTEGER,所以这里使用对位相加,写的有点烂,凑活看 let arr = [] let n = 2; while(line = readline()) { arr.push(line); } for (let i = 0; i<arr...
Javascript V8
2021-10-27
0
584
题解 | #挑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
413
题解 | #计算字符串的距离#
//参考https://www.jianshu.com/p/90af98493661 while(str = readline()) { print(minDistance(str,readline())) // 2 } function minDistance(s1, s2) { ...
Javascript V8
2021-10-26
2
595
题解 | #截取字符串#
while(line = readline()) { const num = parseInt(readline()); print(line.substring(0, num)) }
Javascript V8
2021-10-26
0
409
题解 | #图片整理#
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
479
题解 | #迷宫问题#
//此为 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
1176
题解 | #名字的漂亮度#
//逻辑比较烂,就是自己实现的字母统计完了(reduce比较好用一下就出来了),排序用26递减去乘 let arr = []; while(line = readline()) { arr.push(line); } const length = parseInt(arr[0]); con...
Javascript V8
2021-10-25
0
507
题解 | #统计字符#
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
447
题解 | #求小球落地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
401
首页
上一页
1
2
3
4
下一页
末页