結果
| 問題 |
No.2922 Rose Garden
|
| コンテスト | |
| ユーザー |
aketijyuuzou
|
| 提出日時 | 2025-02-11 14:39:00 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 3,000 ms |
| コード長 | 1,448 bytes |
| コンパイル時間 | 5,690 ms |
| コンパイル使用メモリ | 115,004 KB |
| 実行使用メモリ | 48,292 KB |
| 最終ジャッジ日時 | 2025-02-11 14:39:12 |
| 合計ジャッジ時間 | 8,325 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
コンパイルメッセージ
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.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("3 3 12");
WillReturn.Add("0 10 30");
}
else if (InputPattern == "Input2") {
WillReturn.Add("4 1 100");
WillReturn.Add("0 100 200 0");
}
else if (InputPattern == "Input3") {
WillReturn.Add("10 5 1");
WillReturn.Add("1 0 0 0 0 0 0 0 0 7");
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
long[] wkArr = InputList[0].Split(' ').Select(pX => long.Parse(pX)).ToArray();
long S = wkArr[1];
long B = wkArr[2];
long[] HArr = InputList[1].Split(' ').Select(pX => long.Parse(pX)).ToArray();
long MaxHeight = HArr[0] + S * B;
foreach (long EachH in HArr) {
if (EachH > MaxHeight) {
Console.WriteLine("No");
return;
}
long NewHeight = EachH + S * B;
MaxHeight = Math.Max(MaxHeight, NewHeight);
}
Console.WriteLine("Yes");
}
}
aketijyuuzou