9362022-01-29 15:09:16tomi7Tükörtojás (75 pont)cpp11Time limit exceeded 45/75298ms2744 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
   int n;
   cin>>n;
   string s;
   string finish;
   cin>>s>>finish;
   int valasz=0;
   for(int i=n-1;i>=0;i--){
    //   char ssz=s[i];
  //     char fsz=finish[i];
       if(s[i]!=finish[i]){
           //cout<<"Most itt vagyok!"<<' ';
           for(int j=0;j<i;j++){
               if(s[j]=='F'){
                  s[j]='S';
               }else{
                  s[j]='F';
               }
           }
           valasz++;
       }
   }
   cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/02ms1872 KiB
2Time limit exceeded0/0293ms1360 KiB
3Accepted5/51ms2112 KiB
4Accepted5/51ms2124 KiB
5Accepted5/51ms2128 KiB
6Accepted5/51ms2132 KiB
7Accepted5/51ms2140 KiB
8Accepted5/51ms2144 KiB
9Accepted5/52ms2148 KiB
10Accepted5/51ms2152 KiB
11Accepted5/51ms2156 KiB
12Time limit exceeded0/5298ms1820 KiB
13Time limit exceeded0/5291ms1896 KiB
14Time limit exceeded0/5298ms2092 KiB
15Time limit exceeded0/5252ms2480 KiB
16Time limit exceeded0/5294ms2484 KiB
17Time limit exceeded0/5298ms2744 KiB