QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#22516#2850. 蛋糕blackswallow#Compile Error//C++141.9kb2022-03-09 19:23:072022-05-18 04:13:04

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-18 04:13:04]
  • 评测
  • [2022-03-09 19:23:07]
  • 提交

answer

//Code By CXY07 - It's My Fiesta.
#include<bitsdc++.h>
using namespace std;

//#define FILE
//#define int long long
#define randint(l, r) (rand() % ((r) - (l) + 1) + (l))
#define abs(x) ((x) < 0 ? (-(x)) : (x))
#define popc(x) __builtin_popcount(x)
#define inv(x) qpow((x), mod - 2)
#define lowbit(x) ((x) & (-(x)))
#define ull unsigned long long
#define pii pair<int, int>
#define LL long long
#define mp make_pair
#define pb push_back
#define scd second
#define vec vector
#define fst first
#define endl '\n'
#define y1 _y1

const int MAXN = 101010;
const int INF = 2e9;
const double eps = 1e-6;
const double PI = acos(-1);
//const int mod = 1e9 + 7;
//const int mod = 998244353;
//const int G = 3;
//const int base = 131;

int T, n, m, a[4];
unsigned f[20], g[20], C[20][20];

template<typename T> inline bool read(T &a) {
	a = 0; char c = getchar(); int f = 1;
	while(c < '0' || c > '9') { if(c == '-') f = -1; c = getchar(); }
	while(c >= '0' && c <= '9') { a = a * 10 + (c ^ 48); c = getchar(); }
	return a *= f, true;
}

template<typename A, typename ...B>
inline bool read(A &x, B &...y) { return read(x) && read(y...); }

void solve() {
	for(int i = 0; i < 4; ++i) read(a[i]);
	for(int i = 0; i < 8; ++i) f[i] = g[i] = 0;
	for(int S = 0; S < (1 << 4); ++S) {
		unsigned t = 1;
		for(int i = 0; i < 4; ++i) {
			if((S >> i) & 1) t *= min(2, a[i]);
			else t *= a[i];
		}
		f[popc(S)] += t;
	}
	for(int i = 0; i < 8; ++i) {
		for(int j = i; j < 8; ++j) {
			if((j - i) & 1) g[i] -= f[j] * C[j][i];
			else g[i] += f[j] * C[j][i];
		}
		printf("%u ", g[i] & INT_MAX);
	}
	putchar('\n');
}

signed main () {
#ifdef FILE
	freopen(".in", "r", stdin);
	freopen(".out", "w", stdout);
#endif
	read(T);
	for(int i = 0; i < 20; ++i) {
		C[i][0] = 1;
		for(int j = 1; j <= i; ++j)
			C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
	}
	while(T--) solve();
	return 0;
}

Details

answer.code:2:9: fatal error: bitsdc++.h: No such file or directory
    2 | #include<bitsdc++.h>
      |         ^~~~~~~~~~~~
compilation terminated.