package nowcoder; import java.util.Scanner; public class Main2 {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         int n = sc.nextInt();         int k = sc.nextInt();         int m = sc.nextInt();         System.out.println(Main2.getLess(n, k, m));         sc.close();     }          private static int getLess(int n, int k, int m) {         int t = n * k;         int count = 0;                  while(t > 0) {             t -= Math.min(n, m);             count++;         }                  return count;     } } 思路:用一个方格阵列,横轴为魔兽数,竖轴为技能数。我们的目标是用已有的导师数填充完整个方格。 (1)若导师数 < 魔兽数,优先照顾那些学过技能较少的魔兽。 (2)若导师数 > 魔兽数,那没办法了,一次最多只能教魔兽数=n个魔兽。 执行填充操作的次数就是所需最少次数。 说是AC了...我总有种不祥的预感hhh
点赞 评论

相关推荐

不愿透露姓名的神秘牛友
昨天 15:39
点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务