QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21662#2850. 蛋糕JohnAlfnov#AC ✓45ms3688kbC++20563b2022-03-07 20:05:012022-05-08 03:47:37

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-08 03:47:37]
  • 评测
  • 测评结果:AC
  • 用时:45ms
  • 内存:3688kb
  • [2022-03-07 20:05:01]
  • 提交

answer

#include<bits/stdc++.h>
#define mod 2148473648ll
using namespace std;
int main(){
	int T;
	cin>>T;
	while(T--){
		int a[50];
		cin>>a[1]>>a[2]>>a[3]>>a[4];
		long long an[10];
		for(int i=0;i<=8;++i)an[i]=0;
		for(int s=0;s<16;++s){
			int x=s;
			long long gs=1;
			int he=0;
			for(int i=1;i<=4;++i){
				int ss=x&1;
				x>>=1;
				if(ss)he+=1+(a[i]==1),gs*=min(2,a[i]);
				else gs*=a[i]-min(2,a[i]);
				gs%=mod;
			}
			an[he]=(an[he]+gs)%mod;
		}
		for(int i=0;i<=8;++i)printf("%lld ",an[i]%mod);
		putchar('\n');
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 45ms
memory: 3688kb

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 278697304 483210476 394708 8 0 0 0 
0 0 939058608 754824656 301172 8 0 0 0 
0 0 928825136 750217032 372400 8 0 0 0 
1239780156 506705424 73742516 1370608 16 0 0 0 0 
1867092428 2145345144 1816812716 2484832 16 0 0 0 0 
0 0 0 0 1713974672 250424 4 0 0 
1222501394 1134629934 1413163092 2088456 16 ...

result:

ok 9999 lines