結果

問題 No.1736 Princess vs. Dragoness
ユーザー tentententen
提出日時 2021-11-15 08:57:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 1,646 bytes
コンパイル時間 2,972 ms
コンパイル使用メモリ 75,504 KB
実行使用メモリ 52,624 KB
最終ジャッジ日時 2023-08-20 22:16:00
合計ジャッジ時間 7,740 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,540 KB
testcase_01 AC 44 ms
49,476 KB
testcase_02 AC 43 ms
49,600 KB
testcase_03 AC 58 ms
51,820 KB
testcase_04 AC 66 ms
51,652 KB
testcase_05 AC 46 ms
50,048 KB
testcase_06 AC 87 ms
52,328 KB
testcase_07 AC 95 ms
52,444 KB
testcase_08 AC 69 ms
52,192 KB
testcase_09 AC 75 ms
52,268 KB
testcase_10 AC 46 ms
49,552 KB
testcase_11 AC 99 ms
52,600 KB
testcase_12 AC 69 ms
51,324 KB
testcase_13 AC 90 ms
52,476 KB
testcase_14 AC 97 ms
52,316 KB
testcase_15 AC 75 ms
51,932 KB
testcase_16 AC 60 ms
50,804 KB
testcase_17 AC 88 ms
52,224 KB
testcase_18 AC 89 ms
52,300 KB
testcase_19 AC 74 ms
51,592 KB
testcase_20 AC 58 ms
49,860 KB
testcase_21 AC 88 ms
52,456 KB
testcase_22 AC 93 ms
52,304 KB
testcase_23 AC 81 ms
49,428 KB
testcase_24 AC 49 ms
49,488 KB
testcase_25 AC 60 ms
50,764 KB
testcase_26 AC 83 ms
52,544 KB
testcase_27 AC 78 ms
52,268 KB
testcase_28 AC 71 ms
51,832 KB
testcase_29 AC 70 ms
51,280 KB
testcase_30 AC 77 ms
52,624 KB
testcase_31 AC 87 ms
51,780 KB
testcase_32 AC 90 ms
50,332 KB
testcase_33 AC 43 ms
49,660 KB
testcase_34 AC 43 ms
49,532 KB
testcase_35 AC 44 ms
49,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = sc.nextInt();
        long y = sc.nextInt();
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        for (int i = 0; i < n; i++) {
            queue.add(-sc.nextInt());
        }
        for (int i = 0; i < a && queue.size() > 0; i++) {
            int z = -queue.poll();
            if (z > x) {
                queue.add(x - z);
            }
        }
        long sum = 0;
        while (queue.size() > 0) {
            sum -= queue.poll();
        }
        if (sum <= b * y) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String nextLine() throws Exception {
        return br.readLine();
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0