Output different answers for Codechef IDLE and CodeBlocks IDLE

On codechef, it outputs 0,0,0, but on Codeblocks, it ouputs, 2,0,2, as it should, given the inputs:

3
100001
110111
1010
1010
000
111
#include <bits/stdc++.h>
#include <string>

#define ll long long
#define st static
#define co constant
#define str string
#define pb push_back
#define pf pop_front()
#define nLoop for(ll i = 0; i < n; i++)
#define tLoop for(ll i = 0; i < t; i++)
#define ui unsigned int
#define si signed int
using namespace std;
ll m,n,t,ans;
/*vector<ll> a;
vector<ll> b;
*/
vector<ll> d;
ll c;
string a, b;
void solve()
{
    ans = 0;
    cin >> a >> b;
    c = a.length();
    d.clear(); d.reserve(c);
    for(ll j = 0; j < c; j++){ d[j] = (a[j]!=b[j]);}
    for(ll j = 0; j < c; j++)
    {
        if(d[j]==1&&(j < 2||d[j-1]!=1))++ans;
    }

    cout << ans << "\n";
}
int main() {
    ios::sync_with_stdio(0);cin.tie(0);
    int t = 1;
    cin >> t;
    tLoop
        solve();
}