113212024-08-08 14:06:40bzyTükörtojás (75 pont)cpp17Accepted 75/758ms1136 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int ans = 0;
	string a,b;
	cin >> a >> b;
	int reverse = 1;
	for(int i = n-1;i>=0;i--){
		if(reverse == 1){
			if(a[i] != b[i]){
				ans++;
				reverse*= -1;
			} 
		}
		else if(reverse == -1){
			if(a[i] == b[i]){
				ans++;
				reverse*=-1;
			}
		}
	}
	cout<<ans;
	
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms424 KiB
2Accepted0/06ms656 KiB
3Accepted5/53ms484 KiB
4Accepted5/53ms416 KiB
5Accepted5/53ms632 KiB
6Accepted5/52ms376 KiB
7Accepted5/53ms356 KiB
8Accepted5/53ms356 KiB
9Accepted5/53ms488 KiB
10Accepted5/53ms508 KiB
11Accepted5/53ms376 KiB
12Accepted5/58ms868 KiB
13Accepted5/58ms888 KiB
14Accepted5/58ms1136 KiB
15Accepted5/58ms1040 KiB
16Accepted5/58ms1004 KiB
17Accepted5/58ms888 KiB