結果

問題 No.2218 Multiple LIS
ユーザー 鴨志田卓鴨志田卓
提出日時 2023-02-19 01:40:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 106 ms / 3,000 ms
コード長 415 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 165,916 KB
実行使用メモリ 14,320 KB
最終ジャッジ日時 2023-09-27 13:01:59
合計ジャッジ時間 7,627 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
13,688 KB
testcase_01 AC 59 ms
13,764 KB
testcase_02 AC 59 ms
13,636 KB
testcase_03 AC 58 ms
13,636 KB
testcase_04 AC 58 ms
13,816 KB
testcase_05 AC 58 ms
13,748 KB
testcase_06 AC 62 ms
13,616 KB
testcase_07 AC 55 ms
13,644 KB
testcase_08 AC 61 ms
13,908 KB
testcase_09 AC 59 ms
13,636 KB
testcase_10 AC 55 ms
13,632 KB
testcase_11 AC 55 ms
13,764 KB
testcase_12 AC 55 ms
13,748 KB
testcase_13 AC 56 ms
13,648 KB
testcase_14 AC 57 ms
13,748 KB
testcase_15 AC 58 ms
13,616 KB
testcase_16 AC 61 ms
13,692 KB
testcase_17 AC 60 ms
13,620 KB
testcase_18 AC 60 ms
13,756 KB
testcase_19 AC 62 ms
13,684 KB
testcase_20 AC 59 ms
13,816 KB
testcase_21 AC 60 ms
14,004 KB
testcase_22 AC 75 ms
14,084 KB
testcase_23 AC 88 ms
14,024 KB
testcase_24 AC 65 ms
14,320 KB
testcase_25 AC 95 ms
14,032 KB
testcase_26 AC 105 ms
14,020 KB
testcase_27 AC 105 ms
14,068 KB
testcase_28 AC 105 ms
14,080 KB
testcase_29 AC 106 ms
14,076 KB
testcase_30 AC 102 ms
14,036 KB
testcase_31 AC 80 ms
13,676 KB
testcase_32 AC 80 ms
13,664 KB
testcase_33 AC 89 ms
13,660 KB
testcase_34 AC 86 ms
13,664 KB
testcase_35 AC 87 ms
13,720 KB
testcase_36 AC 74 ms
13,624 KB
testcase_37 AC 95 ms
13,644 KB
testcase_38 AC 59 ms
13,648 KB
testcase_39 AC 65 ms
13,704 KB
testcase_40 AC 91 ms
13,720 KB
testcase_41 AC 88 ms
13,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 10;

int n, dp[N];

vector<int> g[N];

int main() {

    for(int i = N - 1; i > 0; i --)
        for(int j = i; j < N; j += i)
            g[j].push_back(i);

    cin >> n;
    for(int i = 1, x; i <= n; i ++) {
        cin >> x;
        for(int v : g[x])
            dp[x] = max(dp[x], dp[v] + 1);
    }
    cout << *max_element(dp + 1, dp + N);

}
0