39372023-03-05 22:55:02SleepyOverlordNegáló rendezés (55 pont)cpp17Wrong answer 22/5537ms4628 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;
set <VI> all;

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

	if (n <= 8)
	{
		FOR(msk, 0, (1 << n) - 1)
		{
			VI b;
			FOR(i, 0, n - 1)
				if (msk & (1 << i)) b.PB(-a[i + 1]);
				else b.PB(a[i + 1]);
			sort(ALL(b));
			FORN(i, n) b[i] = abs(b[i]);
			all.INS(b);
		}
		PR(all.SZ);
	}
	else
	{
		int sol = 1;
		FOR(i, 2, n) sol = (sol * 2) % MOD;
		PR(sol);
	}

	
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/55
1Accepted0/03ms1812 KiB
2Wrong answer0/035ms2716 KiB
3Accepted2/23ms2376 KiB
4Accepted2/23ms2280 KiB
5Accepted2/23ms2476 KiB
6Accepted2/23ms2720 KiB
7Accepted3/33ms2780 KiB
8Accepted2/22ms2772 KiB
9Accepted3/33ms2776 KiB
10Accepted3/332ms3604 KiB
11Accepted3/335ms3876 KiB
12Wrong answer0/335ms3900 KiB
13Wrong answer0/332ms3904 KiB
14Wrong answer0/335ms4144 KiB
15Wrong answer0/337ms4084 KiB
16Wrong answer0/335ms4080 KiB
17Wrong answer0/332ms4088 KiB
18Wrong answer0/335ms4124 KiB
19Wrong answer0/335ms4204 KiB
20Wrong answer0/335ms4332 KiB
21Wrong answer0/332ms4544 KiB
22Wrong answer0/335ms4628 KiB