結果

問題 No.842 初詣
ユーザー TomoyaTomoya
提出日時 2019-06-28 21:39:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 824 bytes
コンパイル時間 3,407 ms
コンパイル使用メモリ 72,140 KB
実行使用メモリ 57,548 KB
最終ジャッジ日時 2023-09-14 21:44:31
合計ジャッジ時間 7,031 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 122 ms
55,876 KB
testcase_03 AC 122 ms
55,584 KB
testcase_04 AC 122 ms
55,388 KB
testcase_05 AC 123 ms
55,328 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 124 ms
55,428 KB
testcase_10 AC 124 ms
55,820 KB
testcase_11 WA -
testcase_12 AC 123 ms
55,868 KB
testcase_13 AC 122 ms
55,740 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 125 ms
55,740 KB
testcase_18 AC 125 ms
55,780 KB
testcase_19 AC 122 ms
55,488 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        //System.out.println();
        Scanner scanner = new Scanner(System.in);
        
        int[] Val = new int[6];
        for(int i=0; i<6; i++) Val[i] = Integer.parseInt(scanner.next());   
        boolean f = false;
        for(int i=0; i<=Val[0]; i++) {
            for(int j=0; j<=Val[1]; j++) {
                for(int k=0; k<=Val[2]; k++) {
                    for(int l=0; l<=Val[3]; l++) {
                        for(int m=0; m<=Val[4]; m++) {
                            if(i+j+k+l+m == Val[5]) f = true;
                        }
                    }
                }
            }
        }
        if(f) System.out.println("YES");
        else System.out.println("NO");
        
        scanner.close();
    }
}
0