結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2024-02-23 22:34:56
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 4,676 ms
コンパイル使用メモリ 247,016 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-23 22:35:06
合計ジャッジ時間 8,485 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 112 ms
6,676 KB
testcase_02 AC 90 ms
6,676 KB
testcase_03 AC 81 ms
6,676 KB
testcase_04 AC 85 ms
6,676 KB
testcase_05 AC 82 ms
6,676 KB
testcase_06 AC 82 ms
6,676 KB
testcase_07 AC 81 ms
6,676 KB
testcase_08 AC 82 ms
6,676 KB
testcase_09 AC 81 ms
6,676 KB
testcase_10 AC 82 ms
6,676 KB
testcase_11 AC 81 ms
6,676 KB
testcase_12 AC 82 ms
6,676 KB
testcase_13 AC 81 ms
6,676 KB
testcase_14 AC 82 ms
6,676 KB
testcase_15 AC 82 ms
6,676 KB
testcase_16 AC 82 ms
6,676 KB
testcase_17 AC 81 ms
6,676 KB
testcase_18 AC 82 ms
6,676 KB
testcase_19 AC 81 ms
6,676 KB
testcase_20 AC 81 ms
6,676 KB
testcase_21 AC 81 ms
6,676 KB
testcase_22 AC 82 ms
6,676 KB
testcase_23 AC 81 ms
6,676 KB
testcase_24 AC 81 ms
6,676 KB
testcase_25 AC 80 ms
6,676 KB
testcase_26 AC 81 ms
6,676 KB
testcase_27 AC 80 ms
6,676 KB
testcase_28 AC 82 ms
6,676 KB
testcase_29 AC 81 ms
6,676 KB
testcase_30 AC 81 ms
6,676 KB
testcase_31 AC 81 ms
6,676 KB
testcase_32 AC 82 ms
6,676 KB
testcase_33 AC 76 ms
6,676 KB
testcase_34 AC 81 ms
6,676 KB
testcase_35 AC 239 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

void solve(){
    int n;
    cin >> n;
    vector<long long> A(n);
    for (auto& a: A) cin >> a;

    long long l = 0;

    for (int i = 0; i < n-1; i++){
        long long a1 = A[i], a2 = A[i+1];
        
        if (a1 < a2) continue;

        long long dif = a1-a2 + 1;
        l = max(l,dif);

    }
    cout << l << endl;
}
int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++){
        solve();
    }
    return 0;
}
0