saving~
saving~
全部文章
分类
题解(49)
归档
标签
去牛客网
登录
/
注册
saving~的博客
全部文章
(共47篇)
题解 | #输入n个整数,输出其中最小的k个#
let str; while(str = readline()){ let arr = str.split(' '); let num = arr[1]; let findStr = readline(); let findArr = findStr.split(' '); ...
Javascript V8
2021-09-29
0
518
题解 | #成绩排序#
let str; while(str = readline()){ let res = [],old=[]; const sortType = readline(); for(let i=0;i<parseInt(str);i++){ let arr = readline(...
Javascript V8
2021-09-29
0
484
题解 | #整型数组合并#
let str; while(str = readline()){ let res = []; let arr1 = readline().split(' '); readline(); let arr2 = readline().split(' '); let all = a...
Javascript V8
2021-09-29
1
474
题解 | #字符串字符匹配#
let str; while(str = readline()){ let sum = 0; let longStr = readline(); let strArr = str.split(''); for(let v of strArr){ if(longStr.incl...
Javascript V8
2021-09-29
3
534
题解 | #在字符串中找出连续最长的数字串#
let str; while(str = readline()){ let res = str.match(/\d+/g); let max = 0; for(let v of res){ if(v.length>max){ max = v.length; ...
Javascript V8
2021-09-28
0
463
题解 | #数组分组#
//参考网友ld1230的解法 //思想:将能整除3或者5的各自分为一组,记为sum1和sum2,剩余的保存在数组nums里 //现有两组,剩余nums里的数要么在sum1里要么在sum2里,利用递归依次放在sum1和sum2中 //最终nums里的数字全部放进去,若sum1 == sum2,则返回...
Javascript V8
2021-09-28
5
700
题解 | #记票统计#
let str; while(str = readline()){ let people = readline(); let laji = readline(); let piao = readline(); let sum=0,res={}; let pArr = peopl...
Javascript V8
2021-09-28
2
541
题解 | #记负均正II#
let str; let lessZefo = 0,arr=[]; while(str = parseInt(readline())){ if(str < 0){ lessZefo++ }else{ arr.push(str) } } function getRes...
Javascript V8
2021-09-28
0
419
题解 | #合法IP#
let str; while(str = readline()){ console.log(unSafeIp(str.split('.'))) } function unSafeIp(arr){ //无效情况:1.根据.号分割后,输入的不是数字 2.根据.号分割后,数组的长度不等于4 ...
Javascript V8
2021-09-28
0
426
题解 | #名字的漂亮度#
//先按照重复次数去找出字符,然后计算即可 let str; let count = [26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1]; while(str = parseInt(readline())){...
Javascript V8
2021-09-28
0
554
首页
上一页
1
2
3
4
5
下一页
末页