結果

問題 No.736 約比
ユーザー aaa
提出日時 2018-10-07 21:38:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,051 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 96,596 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 14:18:46
合計ジャッジ時間 2,270 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>

using namespace std;


int main(){
	int i, j, k;
	long long n;
	vector<long long>a;


	cin >> n;

	for (i = 0; i < n; i++) {
		long long num;
		cin >> num;
		a.push_back(num);
	}

	while (true)
	{
		bool flag = false, flag2 = false;

		for (i = 2; i <= 122; i++) {
			flag = false;

			for (j = 0; j < a.size(); j++) {
				if (a[j] % i != 0) {
					flag = true;
					break;
				}
			}
			if (flag == true){

			}
			else {
				for (j = 0; j < a.size(); j++) {
					a[j] /= i;
				}
				flag2 = true;
				i = 1;
			}

		}

		if (flag2 == false) {
			break;
		}
	}

	for (j = 0; j < a.size(); j++) {
		cout << a[j];
		if (j != a.size() - 1) {
			cout << ":";
		}
	}
	cout << endl;





	getchar();
	getchar();
	return 0;
}
0