QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#22529 | #2850. 蛋糕 | blackswallow# | WA | 14ms | 3636kb | C++14 | 2.0kb | 2022-03-09 19:38:03 | 2022-04-30 01:18:27 |
Judging History
answer
//Code By CXY07 - It's My Fiesta.
#include<bits/stdc++.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 mod = 2148473648;
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];
int 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) {
int t = 1;
for(int i = 0; i < 4; ++i) {
if((S >> i) & 1) (t *= min(2ll, a[i])) %= mod;
else (t *= a[i]) %= mod;
}
(f[popc(S)] += t) %= mod;
}
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]) %= mod;
else (g[i] += f[j] * C[j][i]) %= mod;
}
printf("%lld ", (g[i] + mod) % mod);
}
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]) % mod;
}
while(T--) solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 14ms
memory: 3636kb
input:
9999 18429 66560 1 13694 48994 1 16287 10018 26028 52162 14916 1 30285 52396 33384 55269 65461 96967 74820 73364 55054 70162 1 1 97285 88897 39444 35439 61069 20048 35664 1 21838 22945 6244 79240 46316 82624 33318 31522 90387 93765 7568 97379 22273 74037 1255 91257 67961 28295 1 36263 20958 87638 59...
output:
0 278697304 483210476 394708 8 0 0 0 0 939058608 754824656 301172 8 0 0 0 0 928825136 750217032 372400 8 0 0 0 1239780156 506705424 73742516 1370608 16 0 0 0 1867092428 2145345144 1816812716 2484832 16 0 0 0 0 0 1713974672 250424 4 0 0 0 1222501394 1134629934 1413163092 2088456 16 0 0 0 0 768...
result:
wrong answer 1st lines differ - expected: '0 0 278697304 483210476 394708 8 0 0 0', found: '0 278697304 483210476 394708 8 0 0 0 '