test

#include <iostream>
#include <cmath>
#include <algorithm> 

using namespace std;
const int mod = 998244353;
const int N = 1e5 + 10; 

long long a[N];

int main()
{
	long long ans = 1;
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	for (int i = 1; i <= n; ++i)
		ans = (ans * __gcd(a[i], 1ll * i - 1)) % mod;
	cout << ans << '\n';
	return 0;
}
posted @ 2025-03-30 09:18  SigmaToT  阅读(13)  评论(0)    收藏  举报