結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー ytftytft
提出日時 2021-12-28 17:02:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 509 bytes
コンパイル時間 1,707 ms
コンパイル使用メモリ 167,408 KB
実行使用メモリ 26,880 KB
最終ジャッジ日時 2024-04-10 08:09:19
合計ジャッジ時間 12,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 89 ms
6,940 KB
testcase_03 AC 170 ms
6,944 KB
testcase_04 AC 173 ms
6,940 KB
testcase_05 AC 173 ms
6,940 KB
testcase_06 AC 165 ms
6,940 KB
testcase_07 AC 172 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 93 ms
6,944 KB
testcase_10 AC 128 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int N,temp;
    multiset<int> A;
    cin>>N;
    int ans[N];
    fill(ans,ans+N,0);
    for(int i=0;i<N;++i){
        cin>>temp;
        A.insert(temp);
    }
    for(int i=1;i<=*A.rbegin();++i){
        temp=0;
        for(int j=i;j<=*A.rbegin();j+=i){
            temp+=A.count(j);
        }
        ans[N-temp]=i;
    }
    cout<<ans[0]<<endl;
    for(int i=1;i<N;++i){
        ans[i]=max(ans[i],ans[i-1]);
        cout<<ans[i]<<endl;
    }
}
0