80452024-01-12 11:26:00Leventusz09Tükörtojás (75 pont)csharpTime limit exceeded 45/75280ms22496 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());
            //s = true                    f= false
            string in1 = Console.ReadLine();
            bool[] S = new bool[N];

            string in2 = Console.ReadLine();
            bool[] S2 = new bool[N];

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

            int o1 = 0;

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

            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/027ms20296 KiB
2Time limit exceeded0/0264ms4952 KiB
3Accepted5/525ms21132 KiB
4Accepted5/525ms21288 KiB
5Accepted5/525ms21752 KiB
6Accepted5/525ms21804 KiB
7Accepted5/525ms21484 KiB
8Accepted5/526ms22048 KiB
9Accepted5/526ms21740 KiB
10Accepted5/526ms22032 KiB
11Accepted5/527ms22496 KiB
12Time limit exceeded0/5273ms7276 KiB
13Time limit exceeded0/5272ms7472 KiB
14Time limit exceeded0/5261ms7412 KiB
15Time limit exceeded0/5268ms8076 KiB
16Time limit exceeded0/5280ms8444 KiB
17Time limit exceeded0/5256ms8408 KiB