結果
問題 | No.2648 [Cherry 6th Tune D] 一次元の馬 |
ユーザー |
![]() |
提出日時 | 2024-02-23 22:05:13 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 462 bytes |
コンパイル時間 | 2,813 ms |
コンパイル使用メモリ | 246,612 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-29 06:45:12 |
合計ジャッジ時間 | 5,498 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#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();}