65182023-12-06 07:12:31NeMNegáló rendezés (55 pont)cpp17Time limit exceeded 5/55300ms11480 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector <pair <int, int>> a (0);
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		bool megtalalt = false;

		for (int j = 0; j < a.size(); j++) {
			if (a[j].first == temp) {
				a[j].second++;
				megtalalt = true;
				break;
			}
		}
		if (!(megtalalt)) {
			a.push_back(pair <int, int> (temp, 1));
		}
	}

	long long counter = 1;
	for (int i = 0; i < a.size(); i++) {
		counter = counter * (a[i].second + 1);
	}
	counter = counter / 2;

	cout << counter % 1000000007;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/55
1Accepted0/03ms1812 KiB
2Time limit exceeded0/0300ms1996 KiB
3Wrong answer0/23ms2720 KiB
4Wrong answer0/23ms2932 KiB
5Wrong answer0/23ms3188 KiB
6Wrong answer0/23ms3252 KiB
7Accepted3/33ms3468 KiB
8Accepted2/23ms3708 KiB
9Wrong answer0/34ms4052 KiB
10Time limit exceeded0/3300ms4176 KiB
11Time limit exceeded0/3270ms4800 KiB
12Wrong answer0/335ms6060 KiB
13Wrong answer0/334ms6592 KiB
14Time limit exceeded0/3263ms6800 KiB
15Wrong answer0/379ms7980 KiB
16Time limit exceeded0/3250ms8152 KiB
17Time limit exceeded0/3261ms8520 KiB
18Time limit exceeded0/3268ms9840 KiB
19Time limit exceeded0/3266ms9540 KiB
20Time limit exceeded0/3268ms10052 KiB
21Time limit exceeded0/3261ms10572 KiB
22Wrong answer0/352ms11480 KiB