結果
| 問題 |
No.390 最長の数列
|
| ユーザー |
vjudge1
|
| 提出日時 | 2025-04-18 16:21:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 558 bytes |
| コンパイル時間 | 1,502 ms |
| コンパイル使用メモリ | 163,428 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-18 16:22:04 |
| 合計ジャッジ時間 | 9,188 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | WA * 1 TLE * 1 -- * 13 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
int const N=1e6+5;
int n,m,sum,cnt,t,ans,a[N];
int c[N];
bool p[N];
signed main()
{
// freopen(".in","r",stdin);
// freopen(".out","r",stdout);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+1+n);
for(int i=1;i<=n;i++)
{
int p=0;
int lst=a[i];
for(int j=i+1;j<=n;j++)
{
if(a[j]%lst==0)
{
p++;
lst=a[j];
}
}
ans=max(p,ans);
}
cout<<ans+1;
return 0;
}
vjudge1