結果
問題 |
No.2335 Jump
|
ユーザー |
|
提出日時 | 2023-06-02 21:30:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 571 bytes |
コンパイル時間 | 4,413 ms |
コンパイル使用メモリ | 103,936 KB |
実行使用メモリ | 28,800 KB |
最終ジャッジ日時 | 2024-12-28 16:32:52 |
合計ジャッジ時間 | 5,705 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
コンパイルメッセージ
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(); public static void Main() { Solve(); } static void Solve() { var n = NN; var a = NList; for (var i = n - 1; i >= 0; --i) { if (i == 0 || a[i - 1] < a[i] - 1) { WriteLine(a[i] - 1 - i); return; } } } }