QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#364016#6696. Three Dicewudibaolong#WA 1ms3844kbC++14787b2024-03-24 09:55:572024-03-24 09:55:58

Judging History

你现在查看的是最新测评结果

  • [2024-03-24 09:55:58]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3844kb
  • [2024-03-24 09:55:57]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

signed main() {
	int A, b; cin >> A >> b;
	int m;
	if (A <= 3) {
		m = A;
	} else {
		m = A / 4 + A % 4;
	}
	if (m > 3) {
		cout << "No";
		return 0;
	} 
	m = 3 - m;
	
	vector<int> a{0, 2, 3, 5, 6};
	vector<vector<vector<int>>> dp(5, vector<vector<int>>(m + 5, vector<int>(100)));
	dp[0][0][0] = 1;
	for (int i = 1; i <= 4; ++i) {
		for (int j = 0; j <= m; ++j) {
			for (int z = 0; z <= m * 6; ++z) {
			
			dp[i][j][z] |= dp[i - 1][j][z];
			if (j >= 1 and z >= a[i])
				dp[i][j][z] |= dp[i - 1][j - 1][z - a[i]];
			}
		}
//		cout << dp[i][0][0] << "\n";
	}
	
//	cout << b << '\n';
//	cout << m << " " << dp[4][m][b] << "\n";
	if (dp[4][m][b]) {
		cout << "Yes";
	} else {
		cout << "No"; 
	}
}
	

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3836kb

input:

4 5

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

3 0

output:

Yes

result:

ok answer is YES

Test #3:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

1 2

output:

No

result:

ok answer is NO

Test #4:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

0 0

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

0 1

output:

No

result:

ok answer is NO

Test #6:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

0 2

output:

No

result:

ok answer is NO

Test #7:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

0 3

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

0 4

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

0 5

output:

No

result:

ok answer is NO

Test #10:

score: -100
Wrong Answer
time: 1ms
memory: 3548kb

input:

0 6

output:

No

result:

wrong answer expected YES, found NO