39422023-03-06 01:06:35SleepyOverlordNegáló rendezés (55 pont)cpp17Elfogadva 55/5537ms5640 KiB
#include <vector>
#include <string> 
#include <set> 
#include <map> 
#include <unordered_set>
#include <unordered_map>
#include <queue> 
#include <bitset> 
#include <stack>
#include <list>

#include <numeric> 
#include <algorithm> 
#include <random>
#include <chrono>

#include <cstdio>
#include <fstream>
#include <iostream> 
#include <sstream> 
#include <iomanip>
#include <climits>

#include <cctype>
#include <cmath> 
#include <ctime>
#include <cassert>

using namespace std;

#define ULL unsigned long long
#define LL long long
#define PII pair <int, int>
#define VB vector <bool>
#define VI vector <int>
#define VLL vector <LL>
#define VD vector <double>
#define VS vector <string>
#define VPII vector <pair <int, int> >
#define VVI vector < VI >
#define VVB vector < VB >
#define SI set < int >
#define USI unordered_set <int>
#define MII map <int, int>
#define UMII unordered_map <int, int>
#define MS multiset
#define US unordered_set
#define UM unordered_map
#define UMS unordered_multiset
#define UMM unordered_multimap

#define FORN(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)

#define SZ size()
#define BG begin() 
#define EN end() 
#define CL clear()
#define X first
#define Y second
#define RS resize
#define PB push_back
#define MP make_pair
#define ALL(x) x.begin(), x.end()
#define INS insert
#define ER erase
#define CNT count

#define IN_FILE "a.in"
#define OUT_FILE "a.out"

template <typename T>
void PR(T var1)
{
	cout << var1 <<endl;
}
template <typename T, typename... Types>
void PR(T var1, Types... var2)
{
	cout << var1;
	PR(var2...);
}

#define MOD 1000000007

int n;
VI a, cnt(100001);

int main()
{
 	cin >> n;
	a.RS(n + 1);
	FOR(i, 1, n) 
	{
		cin >> a[i];
		++cnt[a[i]];
	}

	LL sol = 0;
	FOR(i, 0, 100000)
		if (cnt[i])
			if (sol == 0) sol = 1;
			else sol = sol * (cnt[i] + 1) % MOD;

	PR(sol);

	return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base55/55
1Elfogadva0/03ms2520 KiB
2Elfogadva0/035ms3420 KiB
3Elfogadva2/23ms3072 KiB
4Elfogadva2/23ms3188 KiB
5Elfogadva2/23ms3408 KiB
6Elfogadva2/23ms3780 KiB
7Elfogadva3/33ms3872 KiB
8Elfogadva2/23ms3856 KiB
9Elfogadva3/33ms4016 KiB
10Elfogadva3/332ms4680 KiB
11Elfogadva3/335ms4816 KiB
12Elfogadva3/335ms4904 KiB
13Elfogadva3/332ms4812 KiB
14Elfogadva3/335ms4808 KiB
15Elfogadva3/335ms4780 KiB
16Elfogadva3/335ms4776 KiB
17Elfogadva3/334ms4844 KiB
18Elfogadva3/337ms5032 KiB
19Elfogadva3/335ms5244 KiB
20Elfogadva3/335ms5336 KiB
21Elfogadva3/332ms5520 KiB
22Elfogadva3/335ms5640 KiB