結果

問題 No.846 メダル
ユーザー bluemeganebluemegane
提出日時 2021-11-07 09:49:44
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 979 bytes
コンパイル時間 1,690 ms
コンパイル使用メモリ 67,284 KB
実行使用メモリ 23,636 KB
最終ジャッジ日時 2023-08-08 14:46:44
合計ジャッジ時間 4,773 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,400 KB
testcase_01 AC 58 ms
23,428 KB
testcase_02 AC 60 ms
19,572 KB
testcase_03 AC 60 ms
23,528 KB
testcase_04 AC 58 ms
21,404 KB
testcase_05 AC 59 ms
21,336 KB
testcase_06 AC 60 ms
21,488 KB
testcase_07 AC 59 ms
21,404 KB
testcase_08 AC 62 ms
23,636 KB
testcase_09 AC 62 ms
21,712 KB
testcase_10 AC 63 ms
21,476 KB
testcase_11 AC 63 ms
19,520 KB
testcase_12 AC 61 ms
23,472 KB
testcase_13 AC 60 ms
23,420 KB
testcase_14 AC 62 ms
21,592 KB
testcase_15 AC 60 ms
23,420 KB
testcase_16 AC 59 ms
21,532 KB
testcase_17 AC 62 ms
23,492 KB
testcase_18 AC 59 ms
23,420 KB
testcase_19 AC 59 ms
21,444 KB
testcase_20 AC 62 ms
21,484 KB
testcase_21 AC 62 ms
21,572 KB
testcase_22 AC 61 ms
21,576 KB
testcase_23 AC 59 ms
23,608 KB
testcase_24 AC 60 ms
19,452 KB
testcase_25 AC 61 ms
19,532 KB
権限があれば一括ダウンロードができます

ソースコード

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