Joe--
Joe--
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Joe--的博客
全部文章
/ 题解
(共11篇)
题解 | #简单错误记录#
/** 1.过滤截取路径 2.增加数量 */ let obj = {} let str; while(str = readline()) { const [c, n] = str.split(" "); const s = c.substr(c.lastIndexOf('\\') +...
Javascript V8
2021-11-09
29
835
题解 | #坐标移动#
// 先过滤、后提取 let arr = readline().split(";").filter(f => { if (!f) return false const wasd = f.substr(0, 1) const num = f.substr(1) i...
Javascript V8
2021-11-09
0
326
题解 | #字符个数统计#
let arr = readline().split('') // 方法一 // let str = '' // arr.forEach(el => { // if (str.indexOf(el) === -1) { // str += el // } // ...
Javascript V8
2021-10-27
9
1090
题解 | #字符个数统计#
let arr = readline().split('') let str = '' arr.forEach(el => { if (str.indexOf(el) === -1) { str += el } }) console.log(str.lengt...
Javascript V8
2021-10-27
1
311
题解 | #提取不重复的整数#
let num = readline() let arr = (+(num.split('').reverse().join('')) + '').split('') // 排除0的干扰 let sets = Array.from(new Set(arr)) console.log(sets.joi...
Javascript V8
2021-10-27
0
251
题解 | #提取不重复的整数#
let num = readline() let arr = num.split('').reverse() let sets = Array.from(new Set(arr)) console.log(sets.join(''))
Javascript V8
2021-10-27
1
381
题解 | #合并表记录#
let num = parseInt(readline()) let obj = {} for(let i= 0; i<num; i++) { const [k, v] = readline().split(' ') if (!obj[k]) { obj[k]...
Javascript V8
2021-10-27
0
370
题解 | #取近似值#
let num = `${readline()}` let [l, r] = num.split('.') if (+`0.${r}`>=0.5) { console.log(+l + 1) } else { console.log(l) }
Javascript V8
2021-10-27
0
288
题解 | #质数因子#
let num = parseInt(readline()); let arr = [] // 结果数组 let i = 2; while(i <= num && i * i <= num) { // 没有这个判断超时 i * i <= num if (nu...
Javascript V8
2021-10-27
6
1089
题解 | #字符串分隔#
let line; while(line = readline()) { const len = line.length - 8; if (len <= 0) { print(line.padEnd(8, '0')) } else { w...
Javascript V8
2021-10-19
0
444
首页
上一页
1
2
下一页
末页