結果

問題 No.1736 Princess vs. Dragoness
ユーザー tentententen
提出日時 2022-08-09 08:58:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,570 bytes
コンパイル時間 4,089 ms
コンパイル使用メモリ 78,628 KB
実行使用メモリ 55,524 KB
最終ジャッジ日時 2023-10-19 20:02:03
合計ジャッジ時間 7,031 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
53,600 KB
testcase_01 AC 55 ms
53,608 KB
testcase_02 AC 55 ms
53,608 KB
testcase_03 WA -
testcase_04 AC 89 ms
54,648 KB
testcase_05 AC 56 ms
53,624 KB
testcase_06 AC 85 ms
54,752 KB
testcase_07 AC 107 ms
55,524 KB
testcase_08 AC 91 ms
54,564 KB
testcase_09 AC 103 ms
55,008 KB
testcase_10 AC 56 ms
53,628 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 88 ms
54,492 KB
testcase_14 WA -
testcase_15 AC 73 ms
54,564 KB
testcase_16 AC 70 ms
53,708 KB
testcase_17 WA -
testcase_18 AC 92 ms
54,468 KB
testcase_19 AC 92 ms
54,732 KB
testcase_20 AC 64 ms
53,720 KB
testcase_21 WA -
testcase_22 AC 102 ms
55,272 KB
testcase_23 WA -
testcase_24 AC 58 ms
53,624 KB
testcase_25 AC 73 ms
53,640 KB
testcase_26 WA -
testcase_27 AC 100 ms
54,556 KB
testcase_28 AC 79 ms
54,672 KB
testcase_29 AC 82 ms
54,552 KB
testcase_30 AC 93 ms
54,488 KB
testcase_31 AC 86 ms
54,216 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 54 ms
53,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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();
        int y = sc.nextInt();
        long total = 0;
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        for (int i = 0; i < n; i++) {
            int xx = sc.nextInt();
            queue.add(-xx);
            total += xx;
        }
        for (int i = 0; i < a; i++) {
            int tmp = queue.poll();
            total += tmp;
            tmp = Math.max(0, tmp + x);
            queue.add(tmp);
            total -= tmp;
        }
        if (total <= (long)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 next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0