QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21514 | #2850. 蛋糕 | DaBenZhongXiaSongKuaiDi# | WA | 6ms | 3712kb | C++20 | 747b | 2022-03-07 14:20:15 | 2022-05-08 03:35:22 |
Judging History
answer
#include <bits/stdc++.h>
//#define int long long
#define ll long long
#define db double
#define fi first
#define se second
#define pii pair<int,int>
#define vi vector<int>
using namespace std;
int a[5];
unsigned int f[8][10];
int main() {
int T;
scanf("%d",&T);
while (T--) {
for (int i=1;i<=4;i++) {
scanf("%d",&a[i]);
}
memset(f,0,sizeof(f));
f[0][0]=1;
for (int i=1;i<=4;i++) {
for (int j=0;j<=8;j++) {
if (a[i]==1) {
if (j>=2)
f[i][j]+=f[i-1][j-2];
}
else {if (j>=1)
f[i][j]+=f[i-1][j-1]+f[i-1][j-1];
f[i][j]+=f[i-1][j]*(a[i]-2);
}
}
}
for (int i=0;i<=8;i++) cout<<f[4][i]%2147483648<<' ';
cout<<'\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 3712kb
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 1574086360 485190476 394708 8 0 0 0 0 0 325901312 755814656 301172 8 0 0 0 0 0 1667660544 752197032 372400 8 0 0 0 210762172 120505776 93542516 1370608 16 0 0 0 0 1455446364 459334168 1882152716 2484832 16 0 0 0 0 0 0 0 0 1714964672 250424 4 0 0 645023874 205607214 1456723092 2088456 16 0 ...
result:
wrong answer 1st lines differ - expected: '0 0 278697304 483210476 394708 8 0 0 0', found: '0 0 1574086360 485190476 394708 8 0 0 0 '