QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21520 | #2850. 蛋糕 | gogo# | WA | 6ms | 3588kb | C++20 | 1.4kb | 2022-03-07 14:30:25 | 2022-05-08 03:35:44 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (a); i <= int(b); i ++)
#define per(i, a, b) for(int i = (a); i >= int(b); i --)
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].nxt].to)
#define sz(s) (int)(s.size())
#define lb(s) ((s) & (-s))
#define mk make_pair
#define pb push_back
using namespace std;
typedef unsigned int u32;
typedef long long ll;
typedef pair<int,int> P;
template <typename T> bool chkmx(T &x, T y){return x < y ? x = y, true : false;}
template <typename T> bool chkmn(T &x, T y){return x > y ? x = y, true : false;}
template <int T> using A = array<int, T>;
inline u32 read() {
u32 x = 0, f = 1; char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = 0;
for(; isdigit(c); c = getchar()) x = x * 10 + c - '0';
return f ? x : -x;
}
const int maxn = 10;
u32 a[maxn + 5], f[maxn + 5], g[maxn + 5];
int n;
void solve() {
n = 4;
rep(i, 1, n) a[i] = read();
memset(f, 0, sizeof f);
f[0] = 1;
rep(i, 1, n) {
swap(f, g);
memset(f, 0, sizeof f);
u32 x = a[i] == 1 ? 0 : (a[i] - 2), y = 2 - (a[i] == 1);
rep(j, 0, 2 * i) {
f[j] = g[j] * x + g[j - 1 - (a[i] == 1)] * y;
}
}
rep(i, 0, 8) cout << f[i] % 2148473648ll << " \n"[i == 8];
}
int main() {
//freopen("in.txt", "r", stdin);
for(int T = read(); T; T --) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 3588kb
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 0 1573096360 485190476 394708 8 0 0 0 0 0 324911312 754824656 301172 8 0 0 0 0 0 1666670544 752197032 372400 8 0 0 0 210762172 120505776 93542516 1370608 16 0 0 0 0 1455446364 458344168 1882152716 2484832 16 0 0 0 0 0 0 0 0 1713974672 250424 4 0 0 645023874 205607214 1456723092 2088456 16 0 0 0 0 ...
result:
wrong answer 1st lines differ - expected: '0 0 278697304 483210476 394708 8 0 0 0', found: '0 0 1573096360 485190476 394708 8 0 0 0'