这是一道毒瘤题,我写博客不是因为题目很好,而是很毒瘤。我错了三次终于过了,每次错了都在想哪里多算了,然后看着输出结果与答案逐渐接近,很刺激,像在解谜,一步步接近真相。事实上是我思维有漏洞,没有考虑完整,所以要一次次修改代码。柳岸花明又一村。
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#define mem(a,x) memset(a,x,sizeof(a))
#define s1(x) scanf("%d",&x)
#define s2(x,y) scanf("%d%d",&x,&y)
#define s3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define s4(x,y,z,k) scanf("%d%d%d%d",&x,&y,&z,&k)
#define ff(n,a) for(int i = 0 ; i < n; i++) scanf("%d",a+i)
#define tp(x) printf("x = %d\n",x)
#define ansp(x) printf("%d\n",x)
#define ls 2*rt
#define rs 2*rt+1
#define lson ls,L,mid
#define rson rs,mid+1,R
#define ll long long
using namespace std;
typedef pair<int,int> pii;
const ll inf = 0x3f3f3f3f;const int mx = 1e5+10;
char stra[mx],strb[mx];
int ans=0,n;
int check(int a1,int a2,int b1,int b2){if((a1 == b1&&a2 == b2) ||(a1 == b2&&a2 == b1) || (a1==a2&& b1==b2))return 0;if(a1==a2){if(a1 == b1||a1==b2)return 1;} if(b1==b2){return 1;}if(a1 == b1||a1==b2)return 1;if(a2 == b1||a2==b2)return 1;return 2;
}
int main(){//int T=10; scanf("%d",&T);s1(n);scanf("%s %s",stra,strb);if(n%2){if(stra[n/2] != strb[n/2])ans += 1; } for(int i = 0; i < n/2; i++){ans += check(stra[i],stra[n-i-1],strb[i],strb[n-i-1]);}cout<<ans<<endl;return 0;
}