9512022-02-04 13:07:53tomi7Tükörtojás (75 pont)cpp11Accepted 75/758ms4380 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
   int n;
   cin>>n;
   string s;
   vector<int> a(n);
   string finish;
   cin>>s>>finish;
   int valasz=0;
   for(int i=0;i<n;i++){
      if(finish[i]!=s[i]){
         a[i]=1;
      }
   }
   int segito=0;
   for(int i=n-1;i>=0;i--){
    //   char ssz=s[i];
  //     char fsz=finish[i];
       if(a[i]==1 && segito%2==0){
          valasz++;
          segito++;
       }
       if(a[i]==0 && segito%2==1){
          valasz++;
          segito++;
       }
           //cout<<"Most itt vagyok!"<<' ';
   }
   cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1776 KiB
2Accepted0/04ms2356 KiB
3Accepted5/51ms1960 KiB
4Accepted5/51ms1952 KiB
5Accepted5/51ms1956 KiB
6Accepted5/51ms1964 KiB
7Accepted5/51ms1964 KiB
8Accepted5/51ms1968 KiB
9Accepted5/51ms1976 KiB
10Accepted5/51ms1984 KiB
11Accepted5/51ms1988 KiB
12Accepted5/57ms3512 KiB
13Accepted5/58ms3612 KiB
14Accepted5/57ms3888 KiB
15Accepted5/57ms4024 KiB
16Accepted5/57ms4284 KiB
17Accepted5/57ms4380 KiB