第二题先是用回溯,超时了,后面改了一下,我感觉我是对的,但是感觉有个点被卡了,导致没a😓,有大佬帮忙看下吗 void (async function () { // Write your code here let line1 = await readline(); const n = +line1; let line2 = await readline(); const arr = line2.split(" ").map((i) => +i); let res = new Array(10).fill(0); res[arr[n - 1] % 10]++; // console.log(res) for (let i = n - 2; i >= 0; --i) { let tmp = new Array(10).fill(0); res.forEach((w, idx) => { tmp[(idx + arr[i]) % 10] += w; tmp[(idx * arr[i]) % 10] += w; }); res = tmp; } console.log(res.join(" ")); })();
1

相关推荐

机械打工仔:有说的你怀疑一下就行了,直接问也太实诚了
点赞 评论 收藏
分享
06-12 10:50
门头沟学院 Java
你的不定积分没加C:我怎么在学院群看到了同样的话
点赞 评论 收藏
分享
宇算唯航:目测实缴资本不超100W的小公司
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务