結果
問題 |
No.1132 凸凹
|
ユーザー |
![]() |
提出日時 | 2021-01-15 01:05:35 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 1,089 bytes |
コンパイル時間 | 1,932 ms |
コンパイル使用メモリ | 108,188 KB |
実行使用メモリ | 27,272 KB |
最終ジャッジ日時 | 2024-11-24 21:02:49 |
合計ジャッジ時間 | 3,816 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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}"); } }