結果
| 問題 |
No.979 Longest Divisor Sequence
|
| ユーザー |
noshi91
|
| 提出日時 | 2019-10-07 23:40:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 407 bytes |
| コンパイル時間 | 629 ms |
| コンパイル使用メモリ | 71,424 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-15 01:35:24 |
| 合計ジャッジ時間 | 4,386 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 TLE * 1 -- * 2 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
int n;
std::cin >> n;
std::vector<int> a(n), dp(n);
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
int t = 0;
for (int j = 0; j < i; ++j) {
if (a[i] > a[j] && a[i] % a[j] == 0) {
t = std::max(t, dp[j]);
}
}
dp[i] = t + 1;
}
std::cout << *std::max_element(dp.cbegin(), dp.cend());
}
noshi91