結果
| 問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-23 22:18:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 163 ms / 2,000 ms |
| コード長 | 466 bytes |
| コンパイル時間 | 1,382 ms |
| コンパイル使用メモリ | 162,956 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-20 02:03:53 |
| 合計ジャッジ時間 | 3,676 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
int T;
cin >> T;
while(T--){
ll N;
cin >> N;
vector<ll> a(N+1);
for(i=1;i<=N;i++) cin >> a[i];
ll ans=0;
for(i=2;i<=N;i++){
ll t=max(0LL,a[i-1]+1-a[i]);
ans=max(ans,t);
}
cout << ans << endl;
}
return 0;
}