結果

問題 No.842 初詣
ユーザー TomoyaTomoya
提出日時 2019-06-28 21:41:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 941 bytes
コンパイル時間 3,690 ms
コンパイル使用メモリ 72,816 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2023-09-14 21:45:21
合計ジャッジ時間 6,977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,396 KB
testcase_01 WA -
testcase_02 AC 121 ms
55,780 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 119 ms
55,640 KB
testcase_07 AC 123 ms
55,792 KB
testcase_08 AC 120 ms
55,392 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 119 ms
55,432 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 120 ms
55,692 KB
testcase_15 AC 121 ms
55,400 KB
testcase_16 AC 120 ms
55,772 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 136 ms
56,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main.java.yukicoder;
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[7];
        for(int i=0; i<7; 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++) {
                            for(int n=0; n<=Val[5]; n++) {
                                if(i+j+k+l+m+n == Val[6]) f = true;
                            }
                        }
                    }
                }
            }
        }
        if(f) System.out.println("YES");
        else System.out.println("NO");

        scanner.close();
    }
}
0