結果
| 問題 | No.3474 Concat Decimal |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-03-20 21:56:11 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 134 ms / 2,000 ms |
| コード長 | 707 bytes |
| 記録 | |
| コンパイル時間 | 3,162 ms |
| コンパイル使用メモリ | 337,972 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-20 21:56:17 |
| 合計ジャッジ時間 | 5,532 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
int ttt;
cin>>ttt;
while(ttt--){
int n;
cin>>n;
vector<ll> a(n);
for(int i=0;i<n;i++)cin>>a[i];
ll f=0,g=0;
for(int i=1;i<n;i++){
if(a[i]==0)continue;
while(a[i]%10==0)a[i]/=10;
ll x=0,y=0,z=0;
ll p=pow(10,to_string(a[i]).size());
while(a[i]%2==0&&a[i]!=0){
a[i]*=5;
a[i]/=10;
p/=10;
y++;
a[i]%=p;
}
while(a[i]%5==0&&a[i]!=0){
a[i]*=2;
a[i]/=10;
p/=10;
x++;
a[i]%=p;
}
if(a[i]!=0)z=to_string(a[i]).size();
//cout<<x<<" "<<y<<" "<<z<<endl;
f=max(f,x+z);
g=max(g,y+z);
}
ll ans=((ll)pow(2,f))*((ll)pow(5,g));
cout<<ans<<endl;
}
}