結果

問題 No.1132 凸凹
ユーザー keymoonkeymoon
提出日時 2021-01-15 01:05:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,089 bytes
コンパイル時間 4,826 ms
コンパイル使用メモリ 102,496 KB
実行使用メモリ 24,004 KB
最終ジャッジ日時 2023-08-16 08:58:59
合計ジャッジ時間 7,219 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,940 KB
testcase_01 AC 63 ms
21,940 KB
testcase_02 AC 63 ms
21,824 KB
testcase_03 AC 64 ms
24,004 KB
testcase_04 AC 64 ms
21,956 KB
testcase_05 AC 64 ms
21,904 KB
testcase_06 AC 63 ms
19,948 KB
testcase_07 AC 63 ms
23,960 KB
testcase_08 AC 64 ms
23,944 KB
testcase_09 AC 63 ms
19,764 KB
testcase_10 AC 63 ms
21,780 KB
testcase_11 AC 64 ms
22,064 KB
testcase_12 AC 63 ms
21,812 KB
testcase_13 AC 63 ms
21,884 KB
testcase_14 AC 63 ms
23,868 KB
testcase_15 AC 63 ms
23,944 KB
testcase_16 AC 63 ms
21,948 KB
testcase_17 AC 63 ms
21,820 KB
testcase_18 AC 62 ms
22,052 KB
testcase_19 AC 63 ms
23,764 KB
testcase_20 AC 64 ms
21,884 KB
testcase_21 AC 63 ms
23,868 KB
testcase_22 AC 65 ms
23,924 KB
testcase_23 AC 63 ms
21,892 KB
testcase_24 AC 63 ms
21,716 KB
testcase_25 AC 63 ms
21,884 KB
testcase_26 AC 63 ms
21,880 KB
testcase_27 AC 63 ms
20,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var a = input[0];
        var b = input[1];
        var c = input[2];
        var d = input[3];
        var p = input[4];
        var q = input[5];
        long min = long.MaxValue;
        long minInd = 0;
        long max = long.MinValue;
        long maxInd = 0;
        for (long i = p; i <= q; i++)
        {
            var val = a * i * i * i + b * i * i + c * i + d;
            if (val < min)
            {
                min = val;
                minInd = i;
            }
            if (max < val)
            {
                max = val;
                maxInd = i;
            }
        }
        Console.WriteLine($"{max} {maxInd} {min} {minInd}");
    }
}
0