結果
| 問題 |
No.954 Result
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2019-12-17 00:50:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 873 bytes |
| コンパイル時間 | 1,530 ms |
| コンパイル使用メモリ | 181,660 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 01:31:58 |
| 合計ジャッジ時間 | 2,363 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 7 |
| other | AC * 27 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
int main(){
vector<ll> a(5);
rep(i,5) cin >> a[i];
map<int,ll> mp;
set<ll> st;
mp[0] = 0;
mp[1] = 1;
auto fib = [&](auto& f, int n)->ll{
if (mp.count(n)) return mp[n];
return mp[n] = f(f,n-1) + f(f,n-2);
};
fib(fib,100);
reverse(a.begin(), a.end());
int res = 0;
int idx = 0;
int cnt = 0;
for (auto e : mp) {
if (idx == 5) break;
if (e.second != a[idx]) res = max(res, cnt), cnt = 0;
else cnt++, idx++;
}
res = max(res, cnt);
mp.erase(1);
cnt = 0;
idx = 0;
for (auto e : mp) {
if (idx == 5) break;
if (e.second != a[idx]) res = max(res, cnt), cnt = 0;
else cnt++, idx++;
}
res = max(res, cnt);
cout << res << endl;
return 0;
}
iqueue02