80512024-01-12 11:30:21Leventusz09Tükörtojás (75 pont)csharpTime limit exceeded 45/75284ms22804 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tükörtojás{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            // =: true          !=: false
            string in1 = Console.ReadLine();
            string in2 = Console.ReadLine();
            bool[] S = new bool[N];

            //bool[] S2 = new bool[N];

            for (int i = 0; i < N; i++){
                if (in1[i] == in2[i]) S[i] = true;
                //if (in2[i] == 'S') S2[i] = true;
            }

            int o1 = 0;

            for(int i=N-1; i>=0; i--){
                if(!S[i]){
                    o1++;
                    for(int j=0; j<i; j++){
                        S[j] = !S[j];
                    }
                }
            }

            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/026ms20372 KiB
2Time limit exceeded0/0268ms4500 KiB
3Accepted5/525ms20920 KiB
4Accepted5/526ms21612 KiB
5Accepted5/525ms21820 KiB
6Accepted5/526ms21984 KiB
7Accepted5/526ms22072 KiB
8Accepted5/527ms22272 KiB
9Accepted5/527ms22776 KiB
10Accepted5/527ms22456 KiB
11Accepted5/527ms22804 KiB
12Time limit exceeded0/5257ms7704 KiB
13Time limit exceeded0/5284ms7788 KiB
14Time limit exceeded0/5263ms7904 KiB
15Time limit exceeded0/5263ms8096 KiB
16Time limit exceeded0/5272ms8336 KiB
17Time limit exceeded0/5272ms8044 KiB