結果

問題 No.825 賢いお買い物
ユーザー keymoonkeymoon
提出日時 2020-02-05 15:22:36
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,328 bytes
コンパイル時間 3,244 ms
コンパイル使用メモリ 109,076 KB
実行使用メモリ 25,260 KB
最終ジャッジ日時 2023-10-23 20:24:42
合計ジャッジ時間 2,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 25 ms
25,260 KB
testcase_03 AC 25 ms
25,260 KB
testcase_04 AC 25 ms
25,260 KB
testcase_05 WA -
testcase_06 AC 25 ms
25,260 KB
testcase_07 AC 26 ms
25,260 KB
testcase_08 WA -
testcase_09 AC 26 ms
25,260 KB
testcase_10 AC 26 ms
25,260 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 25 ms
25,260 KB
testcase_14 AC 25 ms
25,260 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

static class P
{
    static void Main()
    {
        var abc = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var a = abc[0];
        var b = abc[1];
        var c = abc[2];
        for (int price = 1; price <= a + b * 10; price++)
        {
            for (int aCount = 0; aCount <= a; aCount++)
            {
                for (int bCount = 0; bCount <= b; bCount++)
                {
                    var pay = aCount + bCount * 10;
                    if (pay < price) continue;
                    var diff = price - pay;
                    var backCount = diff / 10 + diff % 10;
                    if ((a - aCount) + (b - bCount) + backCount == c)
                    {
                        Console.WriteLine(price);
                        return;
                    }
                }
            }
        }
        Console.WriteLine("Impossible");
    }
}
0