結果
| 問題 | No.1730 GCD on Blackboard in yukicoder |
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-12-28 17:02:02 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 1,626 ms |
| コンパイル使用メモリ | 185,808 KB |
| 実行使用メモリ | 20,096 KB |
| 最終ジャッジ日時 | 2026-04-18 19:49:59 |
| 合計ジャッジ時間 | 21,476 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 4 RE * 9 TLE * 6 |
ソースコード
#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;
}
}
ytft