結果

問題 No.842 初詣
ユーザー 1644吉田英陽1644吉田英陽
提出日時 2020-11-11 22:00:57
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 2,339 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 102,804 KB
実行使用メモリ 22,876 KB
最終ジャッジ日時 2023-09-30 00:54:52
合計ジャッジ時間 4,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,832 KB
testcase_01 AC 56 ms
22,720 KB
testcase_02 AC 57 ms
22,876 KB
testcase_03 AC 57 ms
20,816 KB
testcase_04 AC 56 ms
18,732 KB
testcase_05 AC 57 ms
22,748 KB
testcase_06 AC 57 ms
22,848 KB
testcase_07 AC 57 ms
22,772 KB
testcase_08 AC 57 ms
20,876 KB
testcase_09 AC 55 ms
18,680 KB
testcase_10 AC 57 ms
22,716 KB
testcase_11 AC 55 ms
20,880 KB
testcase_12 AC 56 ms
20,708 KB
testcase_13 AC 55 ms
18,620 KB
testcase_14 AC 56 ms
20,828 KB
testcase_15 AC 56 ms
22,744 KB
testcase_16 AC 56 ms
20,780 KB
testcase_17 AC 57 ms
22,780 KB
testcase_18 AC 56 ms
20,868 KB
testcase_19 AC 56 ms
22,776 KB
testcase_20 AC 56 ms
22,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp108
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str =Console.ReadLine().Split();
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int c = int.Parse(str[2]);
            int d = int.Parse(str[3]);
            int e = int.Parse(str[4]);
            int f = int.Parse(str[5]);
            int g = int.Parse(str[6]);
            int seiko = 0;
            for(int i = 0; i <= a; i++)
            {
                for(int I = 0; I <= b; I++)
                {
                    for(int j = 0; j <= c; j++)
                    {
                        for(int J = 0; J <= d; J++)
                        {
                            for(int q = 0; q <= e; q++)
                            {
                                for(int Q = 0; Q <= f; Q++)
                                {
                                    if (500 * i + 100 * I + 50 * j + 10 * J + 5 * q + Q == g)
                                    {
                                        seiko = 1;
                                        Console.WriteLine("YES");
                                        Console.ReadLine();
                                        break;
                                    }
                                }
                                if (seiko == 1)
                                {
                                    break;
                                }
                            }
                            if (seiko == 1)
                            {
                                break;
                            }
                        }
                        if (seiko == 1)
                        {
                            break;
                        }
                    }
                    if (seiko == 1)
                    {
                        break;
                    }
                }
                if (seiko == 1)
                {
                    break;
                }
            }
            if (seiko == 0)
            {
                Console.WriteLine("NO");
                Console.ReadLine();
            }
        }
    }
}
0