結果

問題 No.825 賢いお買い物
ユーザー ひばちひばち
提出日時 2019-05-03 21:38:56
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,147 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 68,476 KB
実行使用メモリ 22,932 KB
最終ジャッジ日時 2023-08-30 06:00:51
合計ジャッジ時間 3,523 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,808 KB
testcase_01 AC 58 ms
22,932 KB
testcase_02 AC 56 ms
20,868 KB
testcase_03 AC 56 ms
22,916 KB
testcase_04 AC 57 ms
20,816 KB
testcase_05 WA -
testcase_06 AC 57 ms
20,808 KB
testcase_07 AC 56 ms
20,760 KB
testcase_08 AC 57 ms
18,852 KB
testcase_09 AC 57 ms
20,828 KB
testcase_10 AC 57 ms
22,824 KB
testcase_11 AC 58 ms
20,848 KB
testcase_12 AC 58 ms
20,828 KB
testcase_13 AC 56 ms
20,748 KB
testcase_14 AC 58 ms
22,852 KB
testcase_15 AC 57 ms
20,796 KB
testcase_16 AC 57 ms
20,832 KB
testcase_17 AC 58 ms
22,860 KB
testcase_18 AC 58 ms
20,832 KB
testcase_19 AC 57 ms
22,868 KB
testcase_20 AC 58 ms
22,880 KB
testcase_21 AC 58 ms
20,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var abc = Input.ar;
        if (abc[0] + abc[1] <= abc[2]) { WriteLine("Impossible");return; }
        var val = abc[0] + 10 * abc[1];
        for(var i = val - 1; i >= 0; i--)
        {
            for(var j=0;j<=abc[2];j++)
            {
                if (j + 10 * (abc[2] - j) == i) { WriteLine(val - i);return; }
            }
        }
        WriteLine("Impossible");
    }
}

public class Input
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(v => read.ToCharArray()).ToArray();
    public static int[][] ar2D(int num)
        => Enumerable.Repeat(0, num).Select(_ => ar).ToArray();
    public static long[][] arL2D(int num)
        => Enumerable.Repeat(0, num).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}
0