結果

問題 No.846 メダル
ユーザー bluemeganebluemegane
提出日時 2021-11-07 09:49:44
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 979 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 110,960 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-04-26 07:28:52
合計ジャッジ時間 2,845 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
18,688 KB
testcase_01 AC 30 ms
18,688 KB
testcase_02 AC 30 ms
18,560 KB
testcase_03 AC 30 ms
18,560 KB
testcase_04 AC 30 ms
19,072 KB
testcase_05 AC 29 ms
18,688 KB
testcase_06 AC 30 ms
18,560 KB
testcase_07 AC 29 ms
18,816 KB
testcase_08 AC 31 ms
18,944 KB
testcase_09 AC 29 ms
18,688 KB
testcase_10 AC 29 ms
18,688 KB
testcase_11 AC 31 ms
19,072 KB
testcase_12 AC 29 ms
19,072 KB
testcase_13 AC 29 ms
18,688 KB
testcase_14 AC 30 ms
18,688 KB
testcase_15 AC 31 ms
18,816 KB
testcase_16 AC 29 ms
18,560 KB
testcase_17 AC 31 ms
18,944 KB
testcase_18 AC 31 ms
18,688 KB
testcase_19 AC 30 ms
18,944 KB
testcase_20 AC 28 ms
18,816 KB
testcase_21 AC 31 ms
18,816 KB
testcase_22 AC 29 ms
19,072 KB
testcase_23 AC 30 ms
18,944 KB
testcase_24 AC 30 ms
18,816 KB
testcase_25 AC 28 ms
18,816 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    public static long p, q, r, a, b, c;
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        p = long.Parse(line[0]);
        q = long.Parse(line[1]);
        r = long.Parse(line[2]);

        line = Console.ReadLine().Trim().Split(' ');
        a = long.Parse(line[0]);
        b = long.Parse(line[1]);
        c = long.Parse(line[2]);
        getAns();
    }
    static void getAns()
    {
        var min = new List<long>();
        var max = new List<long>();
        min.Add((a - 1L) * p + 1L);
        max.Add(p * a);
        min.Add((b - 1L + a) * q + 1L);
        max.Add((b + a) * q);
        min.Add((c - 1L + a + b) * r + 1L);
        max.Add((a + b + c) * r);
        var ans1 = min.Max();
        var ans2 = max.Min();
        if (ans1 > ans2) Console.WriteLine(-1);
        else Console.WriteLine("{0} {1}", ans1, ans2);
    }
}
0