結果

問題 No.2208 Linear Function
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-03-08 18:41:09
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 6,620 ms
コンパイル使用メモリ 157,220 KB
実行使用メモリ 177,308 KB
最終ジャッジ日時 2023-10-18 06:01:21
合計ジャッジ時間 7,511 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
32,204 KB
testcase_01 AC 79 ms
32,520 KB
testcase_02 AC 79 ms
32,572 KB
testcase_03 AC 78 ms
177,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (99 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using System.Linq;

class Program
{

    static void Main(string[] args)
    {
        // Comment

        int T = int.Parse(Console.ReadLine());

        for (int lp = 0 ; lp < T ; lp++){

            int[] li = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int L = li[0];
            int R = li[1];
            int A = li[2];
            int B = li[3];

            int ans;
            if ( A*L+B > A*R+B ){
                ans = A*L+B;
            }else{
                ans = A*R+B;
            }

            Console.WriteLine(ans);

        }
    }
}
0