結果
問題 | No.2208 Linear Function |
ユーザー |
|
提出日時 | 2023-02-18 20:35:20 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 808 bytes |
コンパイル時間 | 1,417 ms |
コンパイル使用メモリ | 107,520 KB |
実行使用メモリ | 19,712 KB |
最終ジャッジ日時 | 2024-07-20 04:28:30 |
合計ジャッジ時間 | 1,831 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using static System.Console;using System.Linq;using System.Collections.Generic;class Program{static int NN => int.Parse(ReadLine());static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray();static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray();public static void Main(){Solve();}static void Solve(){var t = NN;var ans = new int[t];for (var u = 0; u < t; ++u){var c = NList;var (l, r, a, b) = (c[0], c[1], c[2], c[3]);ans[u] = Math.Max(a * l + b, a * r + b);}WriteLine(string.Join("\n", ans));}}