結果
問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
ユーザー |
![]() |
提出日時 | 2024-03-02 14:45:20 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 441 ms / 2,000 ms |
コード長 | 681 bytes |
コンパイル時間 | 14,251 ms |
コンパイル使用メモリ | 171,488 KB |
実行使用メモリ | 187,852 KB |
最終ジャッジ日時 | 2025-06-20 02:05:29 |
合計ジャッジ時間 | 12,405 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (115 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using static System.Math; using System; public class Hello { static void Main() { var T = int.Parse(Console.ReadLine().Trim()); while (T-- > 0) { var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); getAns(n, a); } } static void getAns(int n, int[] a) { var ans = 0; for (int i = 0; i < n - 1; i++) { if (a[i] < a[i + 1]) continue; var d = a[i] - a[i + 1]; ans = Max(ans, d + 1); } Console.WriteLine(ans); } }