結果
問題 | No.2648 [Cherry 6th Tune D] 一次元の馬 |
ユーザー |
![]() |
提出日時 | 2024-02-23 21:37:39 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 2,895 ms |
コンパイル使用メモリ | 244,868 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-29 05:49:56 |
合計ジャッジ時間 | 5,446 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int N; int A[201010]; void solve(){ cin >> N; for(int i = 0;i < N;i++)cin >> A[i]; int mx = 0; for(int i = 0;i < N - 1;i++){ mx = max(mx, A[i] - A[i + 1] + 1); } cout << mx << "\n"; } int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--)solve(); return 0; }