結果
| 問題 |
No.339 何人が回答したのか
|
| コンテスト | |
| ユーザー |
めうめう🎒
|
| 提出日時 | 2016-01-29 22:42:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 733 bytes |
| コンパイル時間 | 596 ms |
| コンパイル使用メモリ | 72,944 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-21 18:23:20 |
| 合計ジャッジ時間 | 2,149 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)
int main() {
int n;
int a[101];
cin >> n;
for(int i = 0;i < n;i++){
cin >> a[i];
}
bool flag = 1,flag2 = 1;
while(flag){
flag = 0;
for(int i = 2;i < 100;i++){
flag2 = 1;
for(int j = 0;j < n;j++){
if(a[j] % i != 0) flag2 = 0;
}
if(flag2) {
for(int j = 0;j < n;j++){
a[j] = a[j] / i;
}
flag = 1;
}
}
}
int ans = 0;
for(int i = 0;i < n;i++){
ans += a[i];
}
cout << ans << endl;
return 0;
}
めうめう🎒