QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#21576 | #2850. 蛋糕 | LFCode# | TL | 0ms | 0kb | C++14 | 1.7kb | 2022-03-07 15:23:37 | 2022-05-08 03:39:28 |
Judging History
answer
#include<bits/stdc++.h>
#include<cstdio>
#include<cctype>
#define ll long long
#define PI pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define ui unsigned int
#define pb push_back
#define llu long long unsigned
using namespace std;
const int MB=1<<20;
struct FastIO{
char ib[MB+100],*p,*q;
char ob[MB+100],*r,stk[128];
int tp;
FastIO(){p=q=ib,r=ob,tp=0;}
~FastIO(){fwrite(ob,1,r-ob,stdout);}
char read_char(){if(p==q){p=ib,q=ib+fread(ib,1,MB,stdin);if(p==q)return 0;}return *p++;}
template<typename T>
void read_int(T& x){char c=read_char(),l=0;for(x=0;!isdigit(c);c=read_char())l=c;for(;isdigit(c);c=read_char())x=x*10-'0'+c;if(l=='-')x=-x;}
void write_char(char c){if(r-ob==MB)r=ob,fwrite(ob,1,MB,stdout);*r++=c;}
template<typename T>
void write_int(T x){if(x<0)write_char('-'),x=-x;do stk[++tp]=x%10+'0';while(x/=10);while(tp)write_char(stk[tp--]);}
}IO;
//IO.read_int(a);c=IO.read_char();IO.write_int(a);//IO.write_char(c);
const ui N=1000010;
ui T,n,a[5],ans[N];
ui lyt(ui wz,ui now){
ui i=now;
ui data1=0;
if(i==0)data1=max(0,(((int)a[wz])-2));
if(i==1){
if(a[wz]==1)data1=0;
else data1=2;
}
if(i==2){
if(a[wz]==1)data1=2;
else data1=0;
}
return data1;
}
signed main(){
scanf("%u",&T);
// T=1;
while(T--){
memset(ans,0,sizeof(ans));
for(ui i=1;i<=4;i++)scanf("%u",&a[i]);
for(ui i=0;i<=2;i++){
ui data1=lyt(1,i);
for(ui o=0;o<=2;o++){
ui data2=lyt(2,o);
for(ui v=0;v<=2;v++){
ui data3=lyt(3,v);
for(ui j=0;j<=2;j++){
ui data4=lyt(4,j);
ans[i+o+v+j]+=data1*data2*data3*data4;
}
}
}
}
for(ui i=0;i<=8;i++)printf("%u ",ans[i]);
printf("\n");
}
return 0;
}
詳細信息
Test #1:
score: 0
Time Limit Exceeded
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 3148172720 970380952 789416 16 0 0 0 0 0 651802624 1511629312 602344 16 0 0 0 0 0 3335321088 1504394064 744800 16 0 0 0 210762172 120505776 93542516 1370608 16 0 0 0 0 1455446364 2606817816 1882152716 2484832 16 0 0 0 0 0 0 0 0 2564891392 1001696 16 0 0 645023874 205607214 1456723092 20884...