結果
| 問題 | No.2648 [Cherry 6th Tune D] 一次元の馬 |
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2024-02-25 15:42:39 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| + 705µs | |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 1,097 ms |
| コンパイル使用メモリ | 214,288 KB |
| 実行使用メモリ | 9,392 KB |
| 最終ジャッジ日時 | 2026-07-12 10:12:38 |
| 合計ジャッジ時間 | 4,830 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fast_io() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
}
int main() {
fast_io();
int t;
cin >> t;
for (; t--;) {
int n;
cin >> n;
vector<long long> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long long ans = 0;
for (int i = 0; i < n - 1; i++) {
ans = max(ans, a[i] - a[i + 1] + 1);
}
cout << ans << "\n";
}
}
eve__fuyuki