結果

問題 No.846 メダル
コンテスト
ユーザー kakel-san
提出日時 2026-04-15 22:02:15
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 773 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,645 ms
コンパイル使用メモリ 172,580 KB
実行使用メモリ 195,876 KB
最終ジャッジ日時 2026-04-15 22:02:30
合計ジャッジ時間 9,512 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (91 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.Intrinsics.Arm;

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var p = NList;
        var a = NList;
        var min = (a[0] - 1) * p[0] + 1;
        var max = a[0] * p[0];
        min = Math.Max(min, (a[0] + a[1] - 1) * p[1] + 1);
        max = Math.Min(max, (a[0] + a[1]) * p[1]);
        min = Math.Max(min, (a[0] + a[1] + a[2] - 1) * p[2] + 1);
        max = Math.Min(max, (a[0] + a[1] + a[2]) * p[2]);
        WriteLine(min > max ? "-1" : $"{min} {max}");
    }
}
0