結果
| 問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
| コンテスト | |
| ユーザー |
nono00
|
| 提出日時 | 2024-02-23 22:05:13 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 462 bytes |
| コンパイル時間 | 3,411 ms |
| コンパイル使用メモリ | 274,432 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-20 02:03:31 |
| 合計ジャッジ時間 | 5,778 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include <bits/stdc++.h>
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) std::cin >> a[i];
int ans = -1;
for (int i = 0; i + 1 < n; i++) {
ans = std::max(ans, a[i] - a[i + 1]);
}
std::cout << ans + 1 << '\n';
}
int main() {
std::cin.tie(0)->sync_with_stdio(0);
std::cout << std::fixed << std::setprecision(16);
int t = 1;
std::cin >> t;
while (t--) solve();
}
nono00