結果
| 問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-20 15:29:39 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,001 bytes |
| コンパイル時間 | 4,106 ms |
| コンパイル使用メモリ | 327,988 KB |
| 最終ジャッジ日時 | 2025-05-15 18:19:18 |
| 合計ジャッジ時間 | 5,051 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
In file included from /usr/include/c++/13/string:43,
from /usr/include/c++/13/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
from main.cpp:4:
/usr/include/c++/13/bits/allocator.h: In destructor ‘constexpr std::_Bvector_base<std::allocator<bool> >::_Bvector_impl::~_Bvector_impl()’:
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long unsigned int]’: target specific option mismatch
184 | ~allocator() _GLIBCXX_NOTHROW { }
| ^
In file included from /usr/include/c++/13/vector:67,
from /usr/include/c++/13/functional:64,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_bvector.h:590:14: note: called from here
590 | struct _Bvector_impl
| ^~~~~~~~~~~~~
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,m,n,k) for (int i = (int)(m); i < (int)(n); i += (int)(k))
#define rrep(i,m,n,k) for (int i = (int)(m); i > (int)(n); i += (int)(k))
#define all(x) x.begin(),x.end()
#define ll long long
#define list(T,A,N) vector<T> A(N);for(int i=0;i<(int)(N);i++){cin >> A[i];}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
// #define int long long
int solve(){
ll N;
cin >> N;
list(ll,A,N);
ll ans = 0;
rep(i,0,N-1,1){
chmax(ans,1 + A[i]-A[i+1]);
}
cout << ans << endl;
return 0;
}
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
cin >> t;
rep(_,0,t,1){
solve();
}
return 0;
}