結果
| 問題 | No.339 何人が回答したのか |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-09 18:29:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 782 bytes |
| コンパイル時間 | 1,408 ms |
| コンパイル使用メモリ | 159,848 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-21 22:01:21 |
| 合計ジャッジ時間 | 3,161 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
ソースコード
#include <bits/stdc++.h>
#include <string>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* pow(x,n)はx^nを返すよ! */
ull pow(ull x,ull n) {
ull res = 1;
while(n > 0) {
if(n&1) res = res * x;
x = x * x;
n >>= 1;
}
return res;
}
int main() {
int i,j,k;
int n;
int a,cnt5=0,cnt2=0;
cin >> n;
for(i=0;i<n;i++) {
cin >> a;
int tmp5=2,tmp2=2;
while(a % 5 == 0) {
tmp5--;
a /= 5;
}
while(a % 2 == 0) {
tmp2--;
a /= 2;
}
if(cnt5 < tmp5) cnt5 = tmp5;
if(cnt2 < tmp2) cnt2 = tmp2;
}
int rep = 1;
for(i=0;i<cnt2;i++) rep *= 2;
for(i=0;i<cnt5;i++) rep *= 5;
cout << rep << endl;
return 0;
}