結果
| 問題 | No.3541 Progression (C++) |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-06-10 23:29:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 269 bytes |
| 記録 | |
| コンパイル時間 | 1,346 ms |
| コンパイル使用メモリ | 211,436 KB |
| 実行使用メモリ | 6,400 KB |
| スコア | 345 |
| 最終ジャッジ日時 | 2026-06-10 23:29:48 |
| 合計ジャッジ時間 | 6,144 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long n,a[2010],i,d,s,c,h;
int main() {
cin>>n;for(i=0;i++<n;){cin>>a[i];}i=0;
if(n==1)cout<<1;else{
d=a[1]-a[0];c=1;
for(;i++<n;){
h=a[i+1]-a[i];
if(h!=d) c=1;
s=max(s,c+++(i!=n));
d=h;
}
cout<<s;
}
}