結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー ococonomy1
提出日時 2024-02-23 21:26:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 2,062 bytes
コンパイル時間 1,081 ms
コンパイル使用メモリ 105,700 KB
最終ジャッジ日時 2025-02-19 19:24:11
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
#define TEST cerr << "TEST" << endl
#define AMARI 998244353
//#define AMARI 1000000007
#define el '\n'
#define El '\n'
template <typename T> vector<T> getvec(int n,T val){
vector<T> ans(n);
for(int i = 0; i < n; i++){
cin >> ans[i];
ans[i] += val;
}
return ans;
}
template <typename T> void printvec(vector<T> const& a,T val){
int n = a.size();
for(int i = 0; i < n; i++){
cout << (a[i] + val);
if(i != n - 1)cout << ' ';
}
cout << '\n';
}
#define MULTI_TEST_CASE true
void solve(void){
//
//
//
//
//
int n;
cin >> n;
vector<ll> a = getvec<ll>(n,0);
ll ans = 0;
for(int i = 0; i < n - 1; i++){
ans = max(ans,a[i] - a[i + 1] + 1);
}
cout << ans << el;
return;
}
void calc(void){
return;
}
signed main(void){
cin.tie(nullptr);
ios::sync_with_stdio(false);
calc();
int t = 1;
if(MULTI_TEST_CASE)cin >> t;
while(t--){
solve();
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0