120852024-12-02 08:49:35RRoliNegáló rendezés (55 pont)cpp17Wrong answer 4/5543ms1700 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, MOD = 1e9;
	cin >> n;
	vector<int> v(n);
	for(int i = 0; i < n; i++) cin >> v[i];

	sort(v.begin(), v.end());
	v.push_back(-1);

	unsigned long long p = 1;
	int c = 1;
	for(int i = 1; i < n; i++) {
		if(v[i] == v[i-1]) c++;
		else {
			p = p*(c+1) % MOD;
			c = 1;
		}
	}
	cout << p;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/55
1Accepted0/01ms320 KiB
2Wrong answer0/043ms1560 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/31ms320 KiB
8Wrong answer0/21ms500 KiB
9Wrong answer0/31ms508 KiB
10Wrong answer0/339ms1520 KiB
11Wrong answer0/343ms1560 KiB
12Wrong answer0/335ms1560 KiB
13Wrong answer0/334ms1600 KiB
14Wrong answer0/341ms1688 KiB
15Wrong answer0/341ms1692 KiB
16Wrong answer0/343ms1640 KiB
17Wrong answer0/341ms1548 KiB
18Wrong answer0/341ms1564 KiB
19Wrong answer0/343ms1564 KiB
20Wrong answer0/341ms1700 KiB
21Wrong answer0/339ms1524 KiB
22Wrong answer0/339ms1568 KiB