結果

問題 No.1736 Princess vs. Dragoness
ユーザー merlinmerlin
提出日時 2021-11-12 21:38:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 904 bytes
コンパイル時間 2,302 ms
コンパイル使用メモリ 77,644 KB
実行使用メモリ 51,456 KB
最終ジャッジ日時 2024-05-04 07:43:33
合計ジャッジ時間 5,122 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
50,052 KB
testcase_01 AC 50 ms
50,004 KB
testcase_02 AC 49 ms
50,388 KB
testcase_03 WA -
testcase_04 AC 55 ms
50,832 KB
testcase_05 AC 50 ms
50,072 KB
testcase_06 AC 63 ms
50,884 KB
testcase_07 AC 67 ms
51,276 KB
testcase_08 AC 60 ms
50,356 KB
testcase_09 AC 67 ms
51,008 KB
testcase_10 AC 50 ms
50,168 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 74 ms
51,128 KB
testcase_14 WA -
testcase_15 AC 56 ms
50,260 KB
testcase_16 AC 52 ms
50,308 KB
testcase_17 WA -
testcase_18 AC 72 ms
51,428 KB
testcase_19 AC 80 ms
51,088 KB
testcase_20 AC 55 ms
50,412 KB
testcase_21 WA -
testcase_22 AC 72 ms
50,912 KB
testcase_23 AC 61 ms
50,800 KB
testcase_24 AC 51 ms
50,156 KB
testcase_25 AC 53 ms
50,412 KB
testcase_26 AC 57 ms
50,348 KB
testcase_27 AC 74 ms
50,884 KB
testcase_28 AC 62 ms
50,384 KB
testcase_29 AC 70 ms
50,644 KB
testcase_30 AC 64 ms
50,828 KB
testcase_31 AC 56 ms
50,448 KB
testcase_32 AC 59 ms
50,372 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 49 ms
50,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int n=Integer.parseInt(s[0]),a=Integer.parseInt(s[1]),b=Integer.parseInt(s[2]),x=Integer.parseInt(s[3]),y=Integer.parseInt(s[4]);
        int i; long h[]=new long[n];
        s=bu.readLine().split(" ");
        for(i=0;i<n;i++) h[i]=Integer.parseInt(s[i]);

        long ded=1l*a*x+1l*b*y;
        boolean ans=true;
        for(i=0;i<n;i++)
        {
            long tem=Math.max(0,Math.min(ded,h[i]));
            h[i]-=tem;
            ded-=tem;
            if(h[i]>0) {ans=false; break;}
        }

        if(ans) sb.append("Yes\n");
        else sb.append("No\n");
        System.out.print(sb);
    }
}
0