烦恼的西红柿在吃瓜 level
获赞
61
粉丝
13
关注
7
看过 TA
925
门头沟学院
2025
Java
IP属地:安徽
暂未填写个人简介
私信
关注
2024-12-09 10:17
门头沟学院 Java
烦恼的西红柿在吃瓜:无空白三方,问签了什么保底,薪资水平,然后要和用人部门商量
0 点赞 评论 收藏
分享
2024-10-17 18:33
门头沟学院 Java
0 点赞 评论 收藏
分享
2024-09-26 10:04
已编辑
门头沟学院 Java
0 点赞 评论 收藏
分享
2024-09-08 12:12
已编辑
门头沟学院 Java
测开,笔试终于ak了一次个位数求和----------------------------------public class Main1 {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别int T = in.nextInt();for(int i = 0; i < T; i++){long n = in.nextLong();System.out.println(fun(n));}}public static long fun(long n){long res = 0L;long tp = n/10;res += 1L*tp*45L;long mod = n % 10;res += mod*(mod+1L)/2L;return res;}}---------------------------------买东西的那一题---------------------------------import java.util.*;public class Main {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n = scanner.nextInt();int k = scanner.nextInt();long m = scanner.nextLong();int[] wallets = new int[n];long res = 0L;//余数为k-1,需要补1个,以此类推TreeMap<Integer, Integer> map = new TreeMap<>((a,b)->b.compareTo(a));for (int i = 0; i < n; i++) {wallets[i] = scanner.nextInt();//取余前直接计算能买的数量,后续对余数操作res += wallets[i] / k;wallets[i] = wallets[i] % k;map.put(wallets[i],map.getOrDefault(wallets[i],0)+1);}//遍历直接扣减for (Map.Entry<Integer, Integer> entry : map.entrySet()) {//key为余数,val为数量int key = entry.getKey();int val = entry.getValue();//System.out.println(key +" "+val);//p为当前余数需要补的数量与m比较long p = 1L*(k-key)*(val);if(m >= p){m -= p;res += val;}else{res = res + m/(k-key);m = 0;break;}}//遍历完成且m>0,补在任何位置都可以if(m > 0){res += m/k;}System.out.println(res);}}
投递字节跳动等公司10个岗位
0 点赞 评论 收藏
分享
2024-08-18 17:28
门头沟学院 Java
投递滴滴等公司10个岗位
0 点赞 评论 收藏
分享
2024-06-18 10:50
已编辑
门头沟学院 Java
xhxhx:团子在大厂里没那么top,应该是这段时间有很多鸽团子的佬,预计要么速通,要么是kpi面
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务