QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#814472#69. Lampsguleng2007#4 6ms5900kbC++20328b2024-12-14 17:46:522024-12-14 17:47:24

Judging History

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

  • [2024-12-14 17:47:24]
  • 评测
  • 测评结果:4
  • 用时:6ms
  • 内存:5900kb
  • [2024-12-14 17:46:52]
  • 提交

answer

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

char a[1000005], b[1000005];

int main()
{
	int n;
	cin >> n;
	scanf("%s",a+1);
	scanf("%s",b+1);

	int cnt=0;
	for(int i=1;i<=n;i++)
		if(b[i]=='1')
			cnt++;

	for(int i=1;i<n;i++)
		if(b[i]=='1' && b[i+1]=='1')
			cnt--;

	printf("%d\n",cnt);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3752kb

input:

1
1
0

output:

0

result:

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

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 4
Accepted

Test #59:

score: 4
Accepted
time: 0ms
memory: 3848kb

input:

1
0
0

output:

0

result:

ok single line: '0'

Test #60:

score: 4
Accepted
time: 0ms
memory: 3884kb

input:

1
0
1

output:

1

result:

ok single line: '1'

Test #61:

score: 4
Accepted
time: 0ms
memory: 3880kb

input:

2
00
00

output:

0

result:

ok single line: '0'

Test #62:

score: 4
Accepted
time: 0ms
memory: 3880kb

input:

2
00
10

output:

1

result:

ok single line: '1'

Test #63:

score: 4
Accepted
time: 0ms
memory: 3864kb

input:

2
00
01

output:

1

result:

ok single line: '1'

Test #64:

score: 4
Accepted
time: 0ms
memory: 3880kb

input:

2
00
11

output:

1

result:

ok single line: '1'

Test #65:

score: 4
Accepted
time: 2ms
memory: 5812kb

input:

1000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok single line: '0'

Test #66:

score: 4
Accepted
time: 6ms
memory: 5836kb

input:

1000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

500000

result:

ok single line: '500000'

Test #67:

score: 4
Accepted
time: 3ms
memory: 5704kb

input:

999999
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

500000

result:

ok single line: '500000'

Test #68:

score: 4
Accepted
time: 6ms
memory: 5900kb

input:

1000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

500000

result:

ok single line: '500000'

Test #69:

score: 4
Accepted
time: 6ms
memory: 5812kb

input:

999999
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

499999

result:

ok single line: '499999'

Test #70:

score: 4
Accepted
time: 3ms
memory: 5820kb

input:

999999
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

1

result:

ok single line: '1'

Test #71:

score: 4
Accepted
time: 6ms
memory: 5700kb

input:

1000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

100

result:

ok single line: '100'

Test #72:

score: 4
Accepted
time: 6ms
memory: 5808kb

input:

999999
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

12345

result:

ok single line: '12345'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%