結果

問題 No.339 何人が回答したのか
ユーザー mmn15277198
提出日時 2021-01-18 23:34:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 397 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 68,392 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 16:19:57
合計ジャッジ時間 2,524 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

int gcd(int a , int b){
	if(a < b)swap(a , b);
	if(a % b == 0)return b;
	else return gcd(b , a  % b);
}

int main(){
	int n;
	cin >> n;
	int x = -1;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(x == -1)x = a;
		else x = gcd(x , a);
	}
	int ans = 100 / x;
	cout << ans << endl;

}



0