80912024-01-12 12:41:19TortelliniJrTükörtojás (75 pont)csharpAccepted 75/7530ms23748 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tukortojasfml
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int sol = 1;
            for (int i = 1; i < n; i++)
            {
                if ((a[i - 1] == b[i-1]) != (a[i] == b[i]))
                {
                    sol++;
                }
            }
            if (a[n - 1] == b[n - 1])
            {
                sol--;
            }
            Console.WriteLine(sol);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/027ms20304 KiB
2Accepted0/028ms21200 KiB
3Accepted5/526ms20980 KiB
4Accepted5/526ms21028 KiB
5Accepted5/526ms21384 KiB
6Accepted5/526ms21528 KiB
7Accepted5/526ms21756 KiB
8Accepted5/526ms21820 KiB
9Accepted5/526ms21888 KiB
10Accepted5/527ms22048 KiB
11Accepted5/527ms21888 KiB
12Accepted5/530ms23264 KiB
13Accepted5/530ms23376 KiB
14Accepted5/529ms23336 KiB
15Accepted5/529ms23748 KiB
16Accepted5/529ms23748 KiB
17Accepted5/528ms23468 KiB