ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

using namespace std;

 

int main() {

	// your code goes here

	int t;

	cin>>t;

	while(t--){

	    int n;

	    cin>>n;

	    string s;

	    cin>>s;

	   // cout<<"hii"<<endl;

	    int lasts=-1;

	    int firstp=-1;

	    int counts=0;

	    int countp=0;

	    bool flag=true;

	    for(int i=0;i<s.size();i++){

	        //cout<<s[i]<<endl;

	        if(s[i]=='s'){

	            lasts=i;

	            counts++;

	        }

	        if(s[i]=='p'){

	            countp++;

	        }

	        if(s[i]=='p' && flag){

	            firstp=i;

	            flag=false;

	        }

	        

	    }

	    //cout<<lasts<<" "<<firstp<<endl;

	    if(counts==0 || countp==0){

	        cout<<"YES"<<endl;

	        continue;

	    }

	    if(lasts>firstp){

	       cout<<"NO"<<endl;

	        continue;

	    }

	   

	    

	    if(counts>1 && countp>1){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    int countdot1=0;

	    int countdot2=0;

	    for(int i=0;i<lasts;i++){

	        if(s[i]=='.')countdot1++;

	    }

	    for(int i=firstp+1;i<s.size();i++){

	        if(s[i]=='.')countdot2++;

	    }

	    

	    if(countdot1>0 && countdot2>0){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    cout<<"YES"<<endl;

	    

	}

 

}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

using namespace std;

 

int main() {

	// your code goes here

	int t;

	cin>>t;

	int i= 1;

	while(t--){

	    int n;

	    cin>>n;

	    string s;

	    cin>>s;

	   // cout<<"hii"<<endl;

	    int lasts=-1;

	    int firstp=-1;

	    int counts=0;

	    int countp=0;

	    bool flag=true;

	    for(int i=0;i<s.size();i++){

	        //cout<<s[i]<<endl;

	        if(s[i]=='s'){

	            lasts=i;

	            counts++;

	        }

	        if(s[i]=='p'){

	            countp++;

	        }

	        if(s[i]=='p' && flag){

	            firstp=i;

	            flag=false;

	        }

	        

	    }

	    //cout<<lasts<<" "<<firstp<<endl;

	    if(counts==0 || countp==0){

	        cout<<"YES"<<endl;

	        continue;

	    }

	    if(lasts>firstp){

	       cout<<"NO"<<endl;

	        continue;

	    }

	   

	    

	    if(counts>1 && countp>1){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    int countdot1=0;

	    int countdot2=0;

	    for(int i=0;i<lasts;i++){

	        if(s[i]=='.')countdot1++;

	    }

	    for(int i=firstp+1;i<s.size();i++){

	        if(s[i]=='.')countdot2++;

	    }

	    

	    if(countdot1>0 && countdot2>0){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    if(countp==1 && countdot2>0){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    if(counts==1 && countdot1>0){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    cout<<"YES"<<endl;

	 

	    

	}



 

}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n;
	    cin>>n;
	    string s;
	    cin>>s;
	   // cout<<"hii"<<endl;
	    int lasts=-1;
	    int firstp=-1;
	    int counts=0;
	    int countp=0;
	    bool flag=true;
	    for(int i=0;i<s.size();i++){
	        //cout<<s[i]<<endl;
	        if(s[i]=='s'){
	            lasts=i;
	            counts++;
	        }
	        if(s[i]=='p'){
	            countp++;
	        }
	        if(s[i]=='p' && flag){
	            firstp=i;
	            flag=false;
	        }
	        
	    }
	    //cout<<lasts<<" "<<firstp<<endl;
	    if(lasts>firstp){
	       cout<<"NO"<<endl;
	        continue;
	    }
	    if(counts==0 || countp==0){
	        cout<<"YES"<<endl;
	        continue;
	    }
	    
	    if(counts>1 && countp>1){
	        cout<<"NO"<<endl;
	        continue;
	    }
	    int countdot1=0;
	    int countdot2=0;
	    for(int i=0;i<lasts;i++){
	        if(s[i]=='.')countdot1++;
	    }
	    for(int i=firstp+1;i<s.size();i++){
	        if(s[i]=='.')countdot2++;
	    }
	    
	    if(countdot1>0 && countdot2>0){
	        cout<<"NO"<<endl;
	        continue;
	    }
	    cout<<"YES"<<endl;
	    
	}

}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

using namespace std;

 

int main() {

	// your code goes here

	int t;

	cin>>t;

	while(t--){

	    int n;

	    cin>>n;

	    string s;

	    cin>>s;

	   // cout<<"hii"<<endl;

	    int lasts=-1;

	    int firstp=-1;

	    int counts=0;

	    int countp=0;

	    bool flag=true;

	    for(int i=0;i<s.size();i++){

	        //cout<<s[i]<<endl;

	        if(s[i]=='s'){

	            lasts=i;

	            counts++;

	        }

	        if(s[i]=='p'){

	            countp++;

	        }

	        if(s[i]=='p' && flag){

	            firstp=i;

	            flag=false;

	        }

	        

	    }

	    //cout<<lasts<<" "<<firstp<<endl;

	    if(counts==0 || countp==0){

	        cout<<"YES"<<endl;

	        continue;

	    }

	    if(lasts>firstp){

	       cout<<"NO"<<endl;

	        continue;

	    }

	   

	    

	    if(counts>1 && countp>1){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    int countdot1=0;

	    int countdot2=0;

	    for(int i=0;i<lasts;i++){

	        if(s[i]=='.')countdot1++;

	    }

	    for(int i=firstp+1;i<s.size();i++){

	        if(s[i]=='.')countdot2++;

	    }

	    

	    if(countdot1>0 && countdot2>0){

	        cout<<"NO"<<endl;

	        continue;

	    }

	    cout<<"YES"<<endl;

	    

	}

 

}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n;
	    cin>>n;
	    string s;
	    cin>>s;
	   // cout<<"hii"<<endl;
	    int lasts=-1;
	    int firstp=-1;
	    int counts=0;
	    int countp=0;
	    bool flag=true;
	    for(int i=0;i<s.size();i++){
	        //cout<<s[i]<<endl;
	        if(s[i]=='s'){
	            lasts=i;
	            counts++;
	        }
	        if(s[i]=='p'){
	            countp++;
	        }
	        if(s[i]=='p' && flag){
	            firstp=i;
	            flag=false;
	        }
	        
	    }
	    //cout<<lasts<<" "<<firstp<<endl;
	    if(lasts>firstp){
	       cout<<"NO"<<endl;
	        continue;
	    }
	    if(counts==0 || countp==0){
	        cout<<"YES"<<endl;
	        continue;
	    }
	    
	    if(counts>1 && countp>1){
	        cout<<"NO"<<endl;
	        continue;
	    }
	    int countdot1=0;
	    int countdot2=0;
	    for(int i=0;i<lasts;i++){
	        if(s[i]=='.')countdot1++;
	    }
	    for(int i=firstp+1;i<s.size();i++){
	        if(s[i]=='.')countdot2++;
	    }
	    
	    if(countdot1>0 && countdot2>0){
	        cout<<"NO"<<endl;
	        continue;
	    }
	    cout<<"YES"<<endl;
	    
	}

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;



int main() {

	// your code goes here

    int t;

    cin>>t;

    while(t--){

        string s;

        cin>>s;

        

        map<int,int> count;

        int sum=0;

        for(int i=0;i<s.length();i++){

            sum=sum+(s[i]-'0');

            if(s[i]=='2'){

                count[2]++;

            }

            if(s[i]=='3'){

                count[6]++;

            }

        }

        int n=count[2]+3*count[6];

        if(sum%9==0){

            cout<<"yes"<<endl;

            continue;

        }

        else if(n==0){

            cout<<"no"<<endl;

            continue;

        }

        bool f1=false;

        for(int i=1;i<=n;i++){

            sum=sum+2;

            if(sum%9==0){

                if(i<=count[2]){

                    cout<<"yes"<<endl;

                    f1=true;

                    break;

                }

                if(i>count[2]){

                    int count2s=i;

                    for(int j=1;j<=count[6];j++){

                        count2s=count2s-3;

                        if(count2s<=count[2]){

                            cout<<"yes"<<endl;

                            f1=true;

                            break;

                        }

                    }

                }

            }

        }

        

        if(!f1){

            cout<<"no"<<endl;

        }

    }

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;



int main() {

	// your code goes here

    int t;

    cin>>t;

    while(t--){

        string s;

        cin>>s;

        

        map<int,int> count;

        int sum=0;

        for(int i=0;i<s.length();i++){

            sum=sum+(s[i]-'0');

            if(s[i]=='2'){

                count[2]++;

            }

            if(s[i]=='3'){

                count[6]++;

            }

        }

        int n=count[2]+3*count[6];

        if(sum%9==0){

            cout<<"yes"<<endl;

            continue;

        }

        else if(n==0){

            cout<<"no"<<endl;

            continue;

        }

        bool f1=false;

        for(int i=1;i<=n;i++){

            sum=sum+2;

            if(sum%9==0){

                if(i<=count[2]){

                    cout<<"yes"<<endl;

                    f1=true;

                    break;

                }

                if(i>count[2]){

                    int count2s=i;

                    for(int j=1;j<=count[6];j++){

                        count2s=count2s-3;

                        if(count2s<=count[2]){

                            cout<<"yes"<<endl;

                            f1=true;

                            break;

                        }

                    }

                }

            }

        }

        

        if(!f1){

            cout<<"no"<<endl;

        }

    }

}



Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

using namespace std;



int main() {

	// your code goes here

    int t;

    cin>>t;

    while(t--){

        string s;

        cin>>s;

        

        map<int,int> count;

        int sum=0;

        for(int i=0;i<s.length();i++){

            sum=sum+(s[i]-'0');

            if(s[i]=='2'){

                count[2]++;

            }

            if(s[i]=='3'){

                count[6]++;

            }

        }

        int n=count[2]+3*count[6];

        if(sum%9==0){

            cout<<"yes"<<endl;

            continue;

        }

        else if(n==0){

            cout<<"no"<<endl;

            continue;

        }

        //cout<<n<<" "<<sum<<endl;

        bool f1=false;

        for(int i=1;i<=n;i++){

            sum=sum+2;

            if(sum%9==0){

                //cout<<i<<endl;

                if(i<=count[2]){

                    cout<<"yes"<<endl;

                    f1=true;

                    break;

                }

                if(i>count[2]){

                    int count2s=i;

                    for(int j=1;j<=count[6];j++){

                        count2s=count2s-3;

                        if(count2s>=0 && count2s<=count[2]){

                            cout<<"yes"<<endl;

                            f1=true;

                            break;

                        }

                    }

                }

            }

        }

        

        if(!f1){

            cout<<"no"<<endl;

        }

    }

}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>

#include <vector>

#include <algorithm>

#include <climits>

#include <queue>

using namespace std;

using ll = long long int;

int main()

{

    ll i, j, n, k, t, d, m, l, v, x, y;

    cin >> t;

    while (t--)

    {

        cin>>n>>x>>y;

        int arr[n+1];

        for(i=1;i<n;i++){

            if(i%2==0){

                arr[i]=1;

            }else{

                arr[i]=0;

            }

        }if(n%2==0){

            arr[n]=1;

        }else{

            arr[n]=2;

        }if(arr[x]==arr[y]){

            if(y==n-1){

                arr[x]=2;

            }else{

                arr[y]=2;

            }

        }for(i=1;i<=n;i++){

            cout<<arr[i]<<" ";

        }cout<<endl;

    }

    return 0;

}



Submission (verdict: Wrong answer on test 1):
#include <iostream>

#include <vector>

#include <algorithm>

#include <climits>

#include <queue>

using namespace std;

using ll = long long int;

int main()

{

    ll i, j, n, k, t, d, m, l, v, x, y;

    cin >> t;

    while (t--)

    {

        cin>>n>>x>>y;

        int arr[n+1];

        for(i=1;i<n;i++){

            if(i%2==0){

                arr[i]=1;

            }else{

                arr[i]=0;

            }

        }if(n%2==0){

            arr[n]=1;

        }else{

            arr[n]=2;

        }if(arr[x]==arr[y]){

            if(y==n-1){

                arr[x]=2;

            }else{

                arr[y]=2;

                if(arr[y+2]==2){

                    arr[y+1]=0;

                }

            }

        }for(i=1;i<=n;i++){

            cout<<arr[i]<<" ";

        }cout<<endl;

    }

    return 0;

}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>

#include <vector>

#include <algorithm>

#include <climits>

#include <queue>

using namespace std;

using ll = long long int;

int main()

{

    ll i, j, n, k, t, d, m, l, v, x, y;

    cin >> t;

    while (t--)

    {

        cin>>n>>x>>y;

        int arr[n+1];

        for(i=1;i<n;i++){

            if(i%2==0){

                arr[i]=1;

            }else{

                arr[i]=0;

            }

        }if(n%2==0){

            arr[n]=1;

        }else{

            arr[n]=2;

        }if(arr[x]==arr[y]){

            if(y==n-1){

                arr[x]=2;

            }else{

                arr[y]=2;

                if(arr[y+2]==2){

                    arr[y+1]=0;

                }

            }

        }for(i=1;i<=n;i++){

            cout<<arr[i]<<" ";

        }cout<<endl;

    }

    return 0;

}



Submission (verdict: Accepted):
#include <iostream>

#include <vector>

#include <algorithm>

#include <climits>

#include <queue>

using namespace std;

using ll = long long int;

int main()

{

    ll i, j, n, k, t, d, m, l, v, x, y;

    cin >> t;

    while (t--)

    {

        cin >> n >> x >> y;

        int arr[n + 1];

        for (i = 1; i < n; i++)

        {

            if (i % 2 == 0)

            {

                arr[i] = 1;

            }

            else

            {

                arr[i] = 0;

            }

        }

        if (n % 2 == 0)

        {

            arr[n] = 1;

        }

        else

        {

            arr[n] = 2;

        }

        if (arr[x] == arr[y])

        {

            if (y == n - 1)

            {

                arr[x] = 2;

            }

            else

            {

                arr[y] = 2;

                if (y != n && arr[y + 2] == 2)

                {

                    arr[y + 1] = 0;

                    arr[n] = 1;

                }

            }

        }

        for (i = 1; i <= n; i++)

        {

            cout << arr[i] << " ";

        }

        cout << endl;

    }

    return 0;

}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <iostream>

#include <vector>

#include <algorithm>

#include <climits>

#include <queue>

using namespace std;

using ll = long long int;

int main()

{

    ll i, j, n, k, t, d, m, l, v, x, y;

    cin >> t;

    while (t--)

    {

        cin>>n>>x>>y;

        int arr[n+1];

        for(i=1;i<n;i++){

            if(i%2==0){

                arr[i]=1;

            }else{

                arr[i]=0;

            }

        }if(n%2==0){

            arr[n]=1;

        }else{

            arr[n]=2;

        }if(arr[x]==arr[y]){

            if(y==n-1){

                arr[x]=2;

            }else{

                arr[y]=2;

            }

        }for(i=1;i<=n;i++){

            cout<<arr[i]<<" ";

        }cout<<endl;

    }

    return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>

using namespace std;



void minSub(int *arr, int i)

{

    for (int j = 0; j < i - 1; j++)

    {

        int mi = min(arr[j], arr[j + 1]);

            arr[j] = arr[j] - mi;

            arr[j + 1] = arr[j + 1] - mi;

    }

}

int main()

{

    ios_base::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        int n, i;

        cin >> n;



        int arr[n];



        for (int j = 0; j < n; j++)

        {

            cin >> arr[j];

        }

            bool isPossible = true;

            for (i = 0; i < n - 1; i++)

            {

                if(arr[i] > arr[i + 1])

                {

                    minSub(arr, i + 1);

                    if (arr[i] > arr[i + 1])

                    {

                        isPossible = false;

                        break;

                    }

                }

            }

            if (isPossible)

            {

                cout<< "YES"<<endl;

            }

            else

            {

                cout<< "NO"<<endl;

            }

    }

    return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>

using namespace std;



void minSub(int *arr, int i)

{

    for (int j = 0; j < i - 1; j++)

    {

        int mi = min(arr[j], arr[j + 1]);

            arr[j] = arr[j] - mi;

            arr[j + 1] = arr[j + 1] - mi;

    }

}

int main()

{

    ios_base::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        int n, i;

        cin >> n;



        int arr[n];



        for (int j = 0; j < n; j++)

        {

            cin >> arr[j];

        }

            bool isPossible = true;

            for (i = 0; i < n - 1; i++)

            {

                if(arr[i] > arr[i + 1])

                {

                    minSub(arr, i + 1);

                    if (arr[i] > arr[i + 1])

                    {

                        isPossible = false;

                        break;

                    }

                }

            }

            if (isPossible)

            {

                cout<< "YES"<<endl;

            }

            else

            {

                cout<< "NO"<<endl;

            }

    }

    return 0;

}

Submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>

using namespace std;



void minSub(int *arr, int i)

{

    for (int j = 0; j < i - 1; j++)

    {

        if (arr[j]>0 && arr[j + 1]> 0 )

        {

            int mi = min(arr[j], arr[j + 1]);

            arr[j] = arr[j] - mi;

            arr[j + 1] = arr[j + 1] - mi;

        }

    }

}

int main()

{

    ios_base::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        int n, i;

        cin >> n;



        int arr[n];



        for (int j = 0; j < n; j++)

        {

            cin >> arr[j];

        }

            bool isPossible = true;

            for (i = 0; i < n - 1; i++)

            {

                if(arr[i] > arr[i + 1])

                {

                    minSub(arr, i + 1);

                    if (arr[i] > arr[i + 1])

                    {

                        isPossible = false;

                        break;

                    }

                }

            }

            if (isPossible)

            {

                cout<< "YES"<<endl;

            }

            else

            {

                cout<< "NO"<<endl;

            }

    }

    return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 8):
#include <bits/stdc++.h>

using namespace std;



void minSub(int *arr, int i)

{

    for (int j = 0; j < i - 1; j++)

    {

        if (arr[j]>0 && arr[j + 1]> 0 )

        {

            int mi = min(arr[j], arr[j + 1]);

            arr[j] = arr[j] - mi;

            arr[j + 1] = arr[j + 1] - mi;

        }

    }

}

int main()

{

    ios_base::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        int n, i;

        cin >> n;



        int arr[n];



        for (int j = 0; j < n; j++)

        {

            cin >> arr[j];

        }

            bool isPossible = true;

            for (i = 0; i < n - 1; i++)

            {

                if(arr[i] > arr[i + 1])

                {

                    minSub(arr, i + 1);

                    if (arr[i] > arr[i + 1])

                    {

                        isPossible = false;

                        break;

                    }

                }

            }

            if (isPossible)

            {

                cout<< "YES"<<endl;

            }

            else

            {

                cout<< "NO"<<endl;

            }

    }

    return 0;

}

Submission (verdict: Accepted):
#include <bits/stdc++.h>

using namespace std;



void minSub(int *arr, int i)

{

    int j = i;

    while (arr[j]>0 && j>0)

    {

        j--;

    }

    for (; j < i - 1; j++)

    {

        

        int mi = min(arr[j], arr[j + 1]);

            arr[j] = arr[j] - mi;

            arr[j + 1] = arr[j + 1] - mi;

    }

}

int main()

{

    ios_base::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        int n, i;

        cin >> n;



        int arr[n];



        for (int j = 0; j < n; j++)

        {

            cin >> arr[j];

        }

            bool isPossible = true;

            for (i = 0; i < n - 1; i++)

            {

                if(arr[i] > arr[i + 1])

                {

                    minSub(arr, i + 1);

                    if (arr[i] > arr[i + 1])

                    {

                        isPossible = false;

                        break;

                    }

                }

            }

            if (isPossible)

            {

                cout<< "YES"<<endl;

            }

            else

            {

                cout<< "NO"<<endl;

            }

    }

    return 0;

}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define lowbit(x) (x & (-x))
#define N 100005
#define MOD (1e9+7)
int t,n;
struct zt
{
    int count;
    int a_idx;
    int b_idx;
};
string a,b,c;
void solve(){
    cin>>a>>b>>c;
    vector<vector<int>>dp(a.size()+2,vector<int>(b.size()+2));
    for (size_t i = 0; i < a.size()+2; i++)
    {
        for (size_t j = 0; j < b.size()+2; j++)
        {
            dp[i][j] = INT_MAX;
        }
        
    }
    
    int ans1 = 0,ans0 = 0;
    dp[1][0] = 1;
    dp[0][1] = 1;
    if (a[0] == c[0]){
        dp[1][0] = 0;

    }
    if (b[0] ==c[0]) dp[0][1] = 0;
    for (size_t i = 2; i < a.size(); i++)
    {
        if (a[i-1] == c[i-1]){dp[i][0]=dp[i-1][0];}
        else{dp[i][0]=dp[i-1][0]+1;}
        if (b[i-1] == c[i-1]){dp[0][i]=dp[0][i-1];}
        else{dp[0][i]=dp[0][i-1]+1;}
    }
    
    
    
    for (size_t i = 1; i <= a.size(); i++)
    {
        for (size_t j = 1; j <= b.size(); j++)
        {
            dp[i][j] = min(dp[i-1][j]+(int)(a[i - 1] != c[i + j - 1]),dp[i][j - 1] + (b[j - 1] != c[i + j - 1]));

        }
        
    }
    cout<<dp[a.size()][b.size()]<<endl;
    

}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>t;
while(t--){
    solve();
}
return 0;
}