import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int T = sc.nextInt(); int[] toy=new int[k]; for (int i = 0; i < k; i++) { toy[i]= sc.nextInt(); } int res=0; PriorityQueue<Integer> pq=new PriorityQueue<>(); for (int i = 0; i < n; i++) { int x=sc.nextInt(); if(pq.size()==0&;&;x==0){ res+=T; }else if(x>0&;&;x-1<k&;&;toy[x-1]<T){//key point pq.add(toy[x-1]); }else if(x==0){ res+=pq.poll(); } } System.out.println(res); } }

相关推荐

04-14 12:52
已编辑
门头沟学院 C++
点赞 评论 收藏
分享
03-31 14:46
已编辑
门头沟学院 Web前端
励志成为双港第一ja...:这其实很正常,离的太远了,他认为你不会来,就为了混个面试,而且成本很高,实习生都优先选本地高校。吃了地域的亏,所有很多时候地域可能比院校层次更重要。
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务