結果
| 問題 |
No.1730 GCD on Blackboard in yukicoder
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-05 21:41:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 366 ms / 2,000 ms |
| コード長 | 322 bytes |
| コンパイル時間 | 677 ms |
| コンパイル使用メモリ | 63,360 KB |
| 実行使用メモリ | 8,320 KB |
| 最終ジャッジ日時 | 2024-11-08 04:33:07 |
| 合計ジャッジ時間 | 7,300 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N;
int cA[1<<20];
int ans[2<<17];
main()
{
cin>>N;
for(int i=0;i<N;i++)
{
int A;cin>>A;
cA[A]++;
}
int mx=0;
for(int d=1<<20;--d;)
{
int c=0;
for(int v=d;v<1<<20;v+=d)c+=cA[v];
while(mx<c)
{
ans[N-++mx]=d;
}
}
for(int i=0;i<N;i++)cout<<ans[i]<<endl;
}