結果

問題 No.1736 Princess vs. Dragoness
ユーザー lotokalotoka
提出日時 2021-12-22 21:45:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,132 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 59,580 KB
最終ジャッジ日時 2023-10-14 23:28:04
合計ジャッジ時間 10,213 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,584 KB
testcase_01 AC 120 ms
55,448 KB
testcase_02 AC 120 ms
55,660 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 134 ms
55,688 KB
testcase_06 WA -
testcase_07 AC 231 ms
58,568 KB
testcase_08 WA -
testcase_09 AC 239 ms
58,572 KB
testcase_10 AC 121 ms
55,968 KB
testcase_11 AC 245 ms
58,856 KB
testcase_12 WA -
testcase_13 AC 217 ms
58,604 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 188 ms
56,912 KB
testcase_17 WA -
testcase_18 AC 201 ms
58,120 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 151 ms
55,980 KB
testcase_25 AC 194 ms
56,880 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 193 ms
57,200 KB
testcase_30 AC 207 ms
58,980 KB
testcase_31 AC 214 ms
56,756 KB
testcase_32 WA -
testcase_33 AC 119 ms
55,784 KB
testcase_34 AC 118 ms
55,804 KB
testcase_35 AC 120 ms
56,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        
        int N = scn.nextInt();
        int A = scn.nextInt();
        int B = scn.nextInt();
        int X = scn.nextInt();
        int Y = scn.nextInt();
        int[] H = new int[N];
        
        int mostNum = 0;
        int mostTime = 0;
        
        int sum = 0;
        
        for(int i = 0; i < N; i++){
            H[i] = scn.nextInt();
        }
        
        for(int i = 0; i < A; i++){
            
            mostNum = 0;
            
            for(int j = 0; j < N; j++){
                if(mostNum < H[j]){
                    mostNum = H[j];
                    mostTime = j;
                }
            }
            
            H[mostTime] -= X;
        }
        
        for(int i = 0; i < N; i++){
            if(H[i] < 0){
                H[i] = 0;
            }
            
            sum += H[i];
        }
        
        if(sum <= B * Y){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}
0