結果
問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
ユーザー |
![]() |
提出日時 | 2024-04-04 22:09:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 254 bytes |
コンパイル時間 | 1,707 ms |
コンパイル使用メモリ | 166,456 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 00:36:37 |
合計ジャッジ時間 | 3,450 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 34 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:9:18: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized] 9 | for(int i=1;i<=n;i++){ | ~^~~ main.cpp:6:9: note: 'n' was declared here 6 | int n; | ^
ソースコード
#include<bits/stdc++.h> using namespace std; int A[200010],ans; int main(){ int t; int n; cin>>t; while(t--){ for(int i=1;i<=n;i++){ cin>>A[i]; } for(int i=1;i<n;i++){ ans=max(ans,A[i]-A[i+1]+1); } cout<<ans<<endl; } }