QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#117533#6625. Binariavalerikk#6 1ms3884kbC++17609b2023-07-01 15:37:022024-05-31 18:45:43

Judging History

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

  • [2024-05-31 18:45:43]
  • 评测
  • 测评结果:6
  • 用时:1ms
  • 内存:3884kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-01 15:37:02]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	vector<int> s(n - k + 1);
	for (int i = 0; i < n - k + 1; ++i) {
		cin >> s[i];
	}
	int ans = 0;
	for (int mask = 0; mask < (1 << n); ++mask) {
		vector<int> a(n);
		for (int i = 0; i < n; ++i) {
			a[i] = ((mask >> i) & 1);
		}
		bool ok = 1;
		for (int i = 0; i < n - k + 1; ++i) {
			int sum = 0;
			for (int j = 0; j < k; ++j) {
				sum += a[i + j];
			}
			if (sum != s[i]) {
				ok = 0;
				break;
			}
		}
		if (ok) {
			++ans;
		}
	}
	cout << ans << "\n";
	return 0;
}

详细

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 1ms
memory: 3648kb

input:

1 1
0

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 3
Accepted
time: 0ms
memory: 3652kb

input:

1 1
1

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 3
Accepted
time: 0ms
memory: 3612kb

input:

10 3
1 2 2 2 2 2 2 2

output:

2

result:

ok 1 number(s): "2"

Test #4:

score: 3
Accepted
time: 0ms
memory: 3872kb

input:

10 3
1 1 0 1 2 3 2 2

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 3
Accepted
time: 1ms
memory: 3652kb

input:

10 3
2 2 2 2 2 2 2 2

output:

3

result:

ok 1 number(s): "3"

Test #6:

score: 3
Accepted
time: 1ms
memory: 3636kb

input:

10 3
2 1 1 1 1 2 2 3

output:

1

result:

ok 1 number(s): "1"

Test #7:

score: 3
Accepted
time: 1ms
memory: 3808kb

input:

10 3
1 1 1 0 0 0 0 0

output:

1

result:

ok 1 number(s): "1"

Test #8:

score: 3
Accepted
time: 0ms
memory: 3836kb

input:

10 3
0 0 0 0 0 0 0 0

output:

1

result:

ok 1 number(s): "1"

Test #9:

score: 3
Accepted
time: 0ms
memory: 3612kb

input:

10 2
1 1 1 1 1 1 1 1 1

output:

2

result:

ok 1 number(s): "2"

Test #10:

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

input:

10 2
1 1 1 1 1 1 1 1 2

output:

1

result:

ok 1 number(s): "1"

Test #11:

score: 3
Accepted
time: 1ms
memory: 3872kb

input:

10 2
1 1 0 0 0 0 0 1 2

output:

1

result:

ok 1 number(s): "1"

Test #12:

score: 3
Accepted
time: 0ms
memory: 3672kb

input:

2 2
1

output:

2

result:

ok 1 number(s): "2"

Subtask #2:

score: 3
Accepted

Dependency #1:

100%
Accepted

Test #13:

score: 3
Accepted
time: 1ms
memory: 3884kb

input:

10 10
7

output:

120

result:

ok 1 number(s): "120"

Test #14:

score: 3
Accepted
time: 1ms
memory: 3644kb

input:

10 10
1

output:

10

result:

ok 1 number(s): "10"

Test #15:

score: 3
Accepted
time: 0ms
memory: 3804kb

input:

10 5
3 4 3 2 3 2

output:

1

result:

ok 1 number(s): "1"

Test #16:

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

input:

10 6
3 3 3 3 4

output:

10

result:

ok 1 number(s): "10"

Test #17:

score: 3
Accepted
time: 0ms
memory: 3872kb

input:

10 4
2 2 2 1 1 1 1

output:

3

result:

ok 1 number(s): "3"

Test #18:

score: 3
Accepted
time: 1ms
memory: 3880kb

input:

10 7
1 2 3 2

output:

1

result:

ok 1 number(s): "1"

Test #19:

score: 3
Accepted
time: 0ms
memory: 3640kb

input:

10 8
8 8 7

output:

1

result:

ok 1 number(s): "1"

Test #20:

score: 3
Accepted
time: 1ms
memory: 3680kb

input:

10 9
4 5

output:

70

result:

ok 1 number(s): "70"

Subtask #3:

score: 0
Wrong Answer

Dependency #2:

100%
Accepted

Test #21:

score: 0
Wrong Answer
time: 1ms
memory: 3648kb

input:

1000 10
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ...

output:

0

result:

wrong answer 1st numbers differ - expected: '210', found: '0'

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%