Submission #7521377


Source Code Expand

Copy
import java.util.*;
import java.lang.*;



public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        PriorityQueue<Long> goods = new PriorityQueue<>(Collections.reverseOrder());
        for(int n=0; n<N; n++) goods.add(sc.nextLong());
        for(int m=0; m<M; m++) goods.add(goods.poll()/2);

        long ans = 0;
        while(!goods.isEmpty()) ans += goods.poll();
        System.out.println(ans);
    }
}

Submission Info

Submission Time
Task D - Powerful Discount Tickets
User NASU41
Language Java8 (OpenJDK 1.8.0)
Score 400
Code Size 550 Byte
Status AC
Exec Time 608 ms
Memory 58656 KB

Judge Result

Set Name All Sample
Score / Max Score 400 / 400 0 / 0
Status
AC × 23
AC × 4
Set Name Test Cases
All sample_01, sample_02, sample_03, sample_04, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_15, testcase_16, testcase_17, testcase_18, testcase_19
Sample sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
sample_01 AC 94 ms 18644 KB
sample_02 AC 96 ms 20948 KB
sample_03 AC 107 ms 21204 KB
sample_04 AC 94 ms 18768 KB
testcase_01 AC 488 ms 46108 KB
testcase_02 AC 289 ms 36244 KB
testcase_03 AC 579 ms 47120 KB
testcase_04 AC 604 ms 51476 KB
testcase_05 AC 392 ms 46504 KB
testcase_06 AC 535 ms 58656 KB
testcase_07 AC 311 ms 37292 KB
testcase_08 AC 588 ms 48596 KB
testcase_09 AC 477 ms 43628 KB
testcase_10 AC 327 ms 39788 KB
testcase_11 AC 442 ms 48552 KB
testcase_12 AC 581 ms 48388 KB
testcase_13 AC 245 ms 28144 KB
testcase_14 AC 558 ms 53520 KB
testcase_15 AC 608 ms 53132 KB
testcase_16 AC 329 ms 40104 KB
testcase_17 AC 95 ms 21844 KB
testcase_18 AC 95 ms 19668 KB
testcase_19 AC 513 ms 51308 KB