QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21508#2850. 蛋糕hy_zheng_zai_nei_juan#WA 41ms3576kbC++20790b2022-03-07 14:18:302022-05-08 03:35:03

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:35:03]
  • 评测
  • 测评结果:WA
  • 用时:41ms
  • 内存:3576kb
  • [2022-03-07 14:18:30]
  • 提交

answer

#include <bits/stdc++.h>

long long mod = 2148473647ll;

int main() {
	std::ios::sync_with_stdio(false);
	//std::cin.tie(nullptr);
	//std::cout.tie(nullptr);
	int T;
	std::cin >> T;
	static long long f[4], tot[10];
	auto dfs = [&](auto &self, long long cur, int k, int cnt) -> void {
		if (k == 4) {
			tot[cnt] += cur;
			tot[cnt] %= mod;
		}
		else {
			if (f[k] == 1) {
				self(self, cur, k + 1, cnt + 2);
			}
			else {
				self(self, cur * (f[k] - 2) % mod, k + 1, cnt);
				self(self, cur * 2 % mod, k + 1, cnt + 1);
			}
		}
	};	
	while (T--) {
		for (int i = 0; i < 4; ++i)
			std::cin >> f[i];
		memset(tot, 0, sizeof tot);
		dfs(dfs, 1, 0, 0);
		for (int i = 0; i < 9; ++i)
			std::cout << tot[i] << " ";
		std::cout << '\n';
	}
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 41ms
memory: 3576kb

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 278705120 483210478 394708 8 0 0 0 
0 0 939062327 754824657 301172 8 0 0 0 
0 0 928834559 750217034 372400 8 0 0 0 
453781893 506978350 73742536 1370608 16 0 0 0 0 
894849911 2147050582 1816812782 2484832 16 0 0 0 0 
0 0 0 0 1713974673 250424 4 0 0 
403085730 1135474974 1413163136 2088456 16 0 0...

result:

wrong answer 1st lines differ - expected: '0 0 278697304 483210476 394708 8 0 0 0', found: '0 0 278705120 483210478 394708 8 0 0 0 '