120872024-12-02 09:01:50RRoliNegáló rendezés (55 pont)cpp17Wrong answer 0/55180ms1080 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, MOD = 1e9+7;
	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;
	bool elso = true;
	for(int i = 1; i <= n; i++) {
		if(v[i] == v[i-1]) c++;
		else {
			cout << c << endl;
			if(!elso) p = p*(c+1) % MOD;
			else elso = false;
			c = 1;
		}
	}
	cout << p;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Wrong answer0/01ms320 KiB
2Wrong answer0/098ms1080 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/31ms320 KiB
8Wrong answer0/21ms320 KiB
9Wrong answer0/33ms320 KiB
10Wrong answer0/3166ms1024 KiB
11Wrong answer0/3180ms1056 KiB
12Wrong answer0/335ms1076 KiB
13Wrong answer0/334ms1060 KiB
14Wrong answer0/375ms1064 KiB
15Wrong answer0/343ms1080 KiB
16Wrong answer0/3103ms1080 KiB
17Wrong answer0/3105ms1048 KiB
18Wrong answer0/359ms1060 KiB
19Wrong answer0/398ms1080 KiB
20Wrong answer0/371ms1060 KiB
21Wrong answer0/354ms1028 KiB
22Wrong answer0/341ms1068 KiB