結果
問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
ユーザー |
|
提出日時 | 2024-02-23 21:28:22 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 258 ms / 2,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 4,672 ms |
コンパイル使用メモリ | 274,372 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-20 02:00:04 |
合計ジャッジ時間 | 8,365 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; constexpr const int maxa=1000000001; int main() { int t; cin>>t; while(t--){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++)cin>>a[i]; int ans=0; for(int i=1;i<n;i++){ ans=max(ans,a[i-1]-a[i]+1); } cout<<ans<<endl; } return 0; }